On Mon, 26 Jun 2023 at 11:13, Eike Dierks via ruby-talk
<ruby-talk(a)ml.ruby-lang.org> wrote:
hi Tomasz
you ask about the rounding in ruby.
but why can we not just let the cpu's do that?
This is a big problem with Java. We do not want to repeat that.
It is not the job of the language to care of every bit of the floats.
I believe that x86 and arm now pretty much agree on ieee 754
It is not the job of the language to intervene with that.
In the end, the differences will only show up in the least significant digit.
It is quite important to have repducible results.
But if an algorithm is that bad, that it would diverge badly?
I actually opt for it, to compute with different roundings.
If you don't want to specify the rounding (to leave it up to the CPU,
as you say) then... don't specify the rounding? This is for people who
actually want to perform precise mathematical calculations with
repeatable results, and would like to continue using Ruby when doing
so.
Cheers
--
Matthew Kerwin
https://matthew.kerwin.net.au/