You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is a subtype of the [`rational`][rational] class, along with
[`integer`][integer].
The type bignum is specified to be exactly (and integer (not fixnum)), which, along with the first line of this paragraph, would then mean that 1/2 is not a valid ratio because neither 1 and 2 are bignums.
I'd rather say something similar to the specification: that numerator and denominator are both integers, their GCD is 1, and numerator must be greater than 1.
I'd also mention that the conversion between ratio and integer is automatic so the programmer doesn't need to worry about overflows or underflows or imprecise computation, but also means that it's easily possible to reach bignum arithmetic and therefore get computation that is slower and consing.
The text was updated successfully, but these errors were encountered:
cl-cookbook/numbers.md
Lines 71 to 82 in fd22cd8
The type
bignum
is specified to be exactly(and integer (not fixnum))
, which, along with the first line of this paragraph, would then mean that1/2
is not a valid ratio because neither1
and2
are bignums.I'd rather say something similar to the specification: that numerator and denominator are both
integer
s, their GCD is 1, andnumerator
must be greater than1
.I'd also mention that the conversion between
ratio
andinteger
is automatic so the programmer doesn't need to worry about overflows or underflows or imprecise computation, but also means that it's easily possible to reach bignum arithmetic and therefore get computation that is slower and consing.The text was updated successfully, but these errors were encountered: