|
From: Ethan M. <eam...@gm...> - 2017-11-15 01:03:29
|
On Tue, Nov 14, 2017 at 4:38 PM, Tait <gnu...@t4...> wrote:
>
> It's worth mentioning that Python has changed this behavior. In
> Python2, division defaults to integer-division and 1/2 is 0.
> Starting with Python3 (which in my experience is used everywhere
> except niche applications by now) "true" division applies,
> meaning types are auto-promoted such that 1/2 is 0.5.
>
My experience differs. I have seen hardly a sign of Python3.
Then again, probably every single application in my field counts as "niche".
Either way I really, really don't think we want to use Python as a guide.
I'd say integer division is gradually becoming an anachronism,
> and the new trend seems to be not just fixed floating-point but
> full rational-number support or arbitrary- (even infinite-)
> precision calculations, to avoid frustrating behaviors like
> ceil(900e-7/12e-7) => 76.
>
There you intrigue me. I have a patch series queued that adds 64-bit
integer arithmetic with full overflow handling everywhere. Would it indeed
be feasible to similarly upgrade the floating point evaluation code to
provide more graceful handling of very large numbers?
The int64 conversion was surprisingly easy so I can believe that
modernizing the floating point would also be straightforward.
But I wouldn't know where to start. Do you have suggestions?
Ethan
|