On Sunday, 16 April 2023 at 14:31:43 UTC-7 aw wrote: Awesome, let's talk about floating point semantics. [...] We zero-pad the 1.1 to whatever length is needed to match the other number. Because we see 1.1 as a shorthand for 1.1000000000000.... (infinitely many zeros)
That's the ordinary-person semantics of the string "1.1". That's not floating-point semantics. That's just a funny way of writing 11/10. Those are also not the semantics that scientific calculators use (or excel for that matter), so I suspect that "ordinary persons" are already quite used to 1.1 not meaning an exact rational number but a possible approximation to something quite close to 11/10. In fact, I've seen people use this as an argument why standard units are more precise than metric: one would talk about 5/16 in, but that is only approximately 0.79375 cm (I'm not saying I'm convinced by the argument, but it is a good illustration that ordinary people are quite aware of rounding errors in decimal fraction notation) The fact that computers often don't use base-10 floating point but base-2 floating point is a more subtle trap, but once you're realizing that doing floating point arithmetic quickly leads to not all your digits being accurate, those difference tend to only be in digits that you shouldn't be trusting anyway. Perhaps you're interested in exploring RealLazyField. It actually attempts to provide a framework to compute with (some) real numbers exactly. I don't think it's ready to be the default just yet, if ever. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/03e8ce36-52e5-44b3-986d-984c5ae9ef6fn%40googlegroups.com.