fix mod error

This commit is contained in:
Scott Richmond 2024-06-07 17:25:46 -04:00
parent 9a3217b2c9
commit 92a1ee9010
3 changed files with 9 additions and 12 deletions

View File

@ -879,7 +879,7 @@ fn atan/2 {
fn mod { fn mod {
"Returns the modulus of num and div. Truncates towards negative infinity." "Returns the modulus of num and div. Truncates towards negative infinity."
(num as :number, y as :number) -> base :mod (num, div) (num as :number, div as :number) -> base :mod (num, div)
} }
fn square { fn square {

View File

@ -221,6 +221,12 @@
(defn store! [b x] (set (b :^value) x)) (defn store! [b x] (set (b :^value) x))
(defn mod [x y]
(print "mod!")
(pp x)
(pp y)
(% x y))
(def ctx { (def ctx {
"print!" print! "print!" print!
"prn" prn "prn" prn
@ -232,7 +238,7 @@
"sub" - "sub" -
"mult" * "mult" *
"div" / "div" /
"mod" % "mod" mod
"gt" > "gt" >
"gte" >= "gte" >=
"lt" < "lt" <

View File

@ -56,14 +56,5 @@
# (comment # (comment
(do (do
(-> (ludus ` (-> (ludus `
penup! () doc! (mod)
let s = turtle_state ()
pendown! ()
forward! (100)
rt! (0.25)
fd! (100)
load_turtle_state! (s)
pendown! ()
lt! (0.25)
fd! (50)
`))) `)))