mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
Why the naming discrepancy? My thinking is that I want both Decimal and Rational as internal representation, so Value can be decimal or rational. But what is a good name for "decimal or rational"? I can think of "number", but I want to reserve that for the supertype of int and this one. "Rational" would be technically correct because decimals are also rationals, just with a power of 10 denominator. But then what if I put a sqrt function in there, or an approximation of pi? Sure technically they are approximations, but I think this would _also_ be weird. So let's go with float ... Also, this is what Cue calls them so there is precedent.
13 lines
201 B
Text
13 lines
201 B
Text
[
|
|
// Still okay:
|
|
9223372036854775807,
|
|
// Overflow:
|
|
9223372036854775808,
|
|
]
|
|
|
|
# output:
|
|
stdin:5:3
|
|
╷
|
|
5 │ 9223372036854775808,
|
|
╵ ^~~~~~~~~~~~~~~~~~~
|
|
Error: Overflow in number literal.
|