The Lambda Lab
/
projects
/
forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
990c32e
)
Fixed bugs in c*, cmagsq
author
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 26 Apr 2016 21:09:46 +0000
(09:09 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 26 Apr 2016 21:09:46 +0000
(09:09 +1200)
examples/mandelbrot.4th
patch
|
blob
|
history
diff --git
a/examples/mandelbrot.4th
b/examples/mandelbrot.4th
index
2767738
..
254628c
100644
(file)
--- a/
examples/mandelbrot.4th
+++ b/
examples/mandelbrot.4th
@@
-1,7
+1,7
@@
( --- Complex integer arithmetic --- )
: c* ( x1 y1 x2 y2 -- x3 y3 )
- swap
rot
( x1 x2 y1 y2 )
+ swap
-rot
( x1 x2 y1 y2 )
2dup * negate ( x1 x2 y1 y2 -y1y2 )
4 pick 4 pick * + ( x1 x2 y1 y2 (x1x2-y1y2))
4 roll 2 roll * ( x2 y1 (x1x2-y1y2) x1y2 )
@@
-16,7
+16,7
@@
: csq 2dup c* ;
-
;
cmagsq ( x1 y1 -- mag )
+
:
cmagsq ( x1 y1 -- mag )
csq abs
;