Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for runtime ratio object #137

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jianlingzhong
Copy link
Contributor

@jianlingzhong jianlingzhong commented Nov 24, 2024

everything should work.

❯ build/jank repl
Bottom of clojure.core
clojure.core=> (+ 1/2 1/3)
5/6
clojure.core=> (- 1/2 1/3)
1/6
clojure.core=> (* 1/2 1/3)
1/6
clojure.core=> (/ 1/2 1/3)
3/2
clojure.core=> (+ 1/2 1/2)
1
clojure.core=> (+ 1/2 1)
3/2
clojure.core=> (+ 1 1/3)
4/3
clojure.core=> (+ 1.0 1/3)
1.3333333333333333
clojure.core=> (+ 1.0 -1/3)
0.6666666666666667
clojure.core=> (* 1.0 -1/3)
-0.3333333333333333
clojure.core=> (> 1 1/3)
true
clojure.core=> (< 1 1/3)
false
clojure.core=> (== 1 1/1)
true
clojure.core=> (== 2 1/2)
false
clojure.core=> (mod 4/5 2)
0.8
clojure.core=> (mod 0.8 2)
0.8
clojure.core=> (mod 16/5 2)
1.2000000000000002
clojure.core=> (mod 16/5 3/2)
0.20000000000000018
clojure.core=> (mod (/ 16.0 5) (/ 3.0 2))
0.20000000000000018
clojure.core=> (<= (/ 1.0 3) 1/3)
true
clojure.core=> (== 1/3 0.3333)
false
clojure.core=> (== 1/3 0.3333333333333333333333)
true

this closes #66.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ratio support
2 participants