This namespace provides a number of functions and constructors for working with ratios in Clojure and ClojureScript.
[[clojure.lang.Ratio]] is native in Clojure. The ClojureScript implementation uses Fraction.js.
For other numeric extensions, see [[emmy.numbers]]
and emmy.complex.
This namespace provides a number of functions and constructors for working with ratios in Clojure and ClojureScript. [[clojure.lang.Ratio]] is native in Clojure. The ClojureScript implementation uses [Fraction.js](https://github.com/infusion/Fraction.js/). For other numeric extensions, see [[emmy.numbers]] and [[emmy.complex]].
(parse-ratio x)Parser for the #emmy/ratio literal.
Parser for the `#emmy/ratio` literal.
(rationalize x)(rationalize n d)Construct a ratio.
Construct a ratio.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |