YouTube
@foo @mcc so weird how floats are automatically everywhere but rationals are almost never first class
@leon @foo @mcc Rationals are supported by most common languages. I use them when possible, as well as high precision math libraries. Check other languages in [https://en.wikipedia.org/wiki/Rational_data_type].
Rational data type - Wikipedia

@pedromj @foo @mcc yeah, they’re usually supported but they’re definitely not *first class*. If I type a literal 0.5 pretty much anywhere that isn’t going to be a rational, despite the fact that’s the least lossy representation, and I’m almost certainly only going to be able to use them with a small subset of functions.
@pedromj @foo @mcc like if I was designing a language I’d make you use an unsafe-style keyword escape hatch every time you wanted to force it to use a floating point, with compiler warnings explaining to them that it’s almost certainly not what they want because it almost certainly isn’t