haskell: Phase 10 — Floating stub: pi, exp, log, sin, cos, ** (+6 tests, 37/37)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 08:28:11 +00:00
parent e27daee4a8
commit 882815e612
3 changed files with 25 additions and 1 deletions

View File

@@ -440,6 +440,7 @@
((= op "div") (floor (/ lv rv)))
((= op "rem") (mod lv rv))
((= op "quot") (truncate (/ lv rv)))
((= op "**") (pow lv rv))
((= op ">>=")
(if
(and (list? lv) (= (first lv) "IO"))
@@ -814,6 +815,11 @@
env
"fromRational"
(hk-mk-builtin "fromRational" (fn (x) x) 1))
(dict-set! env "pi" 3.14159)
(dict-set! env "exp" (hk-mk-builtin "exp" (fn (x) (exp x)) 1))
(dict-set! env "log" (hk-mk-builtin "log" (fn (x) (log x)) 1))
(dict-set! env "sin" (hk-mk-builtin "sin" (fn (x) (sin x)) 1))
(dict-set! env "cos" (hk-mk-builtin "cos" (fn (x) (cos x)) 1))
(let
((--sx-to-hk-- (fn (lst) (if (empty? lst) (list "[]") (list ":" (first lst) (--sx-to-hk-- (rest lst))))))
(--words--