On 2020-02-20 2:22 p.m., ToddAndMargo via perl6-users wrote:
On 2020-02-20 00:41, Darren Duncan wrote:
On 2020-02-20 12:10 a.m., Tobias Boege wrote:
Granted, Todd would not have anticipated this answer if he calls
arbitrary length integers "magic powder" and the question "I have
computed this Int/Num/Rat in Raku, is it rational?" does indeed
not make any sense.  But there are computer languages that can do
better.  Given FatRats, such modules can be written for Raku today.

Actually the question "is it rational" DOES make sense, however its answer is trivial, the answer is always "yes"; EVERY (not-NaN/Inf/etc) number a language-defined Raku data type can represent is exactly expressible as the ratio of 2 integers. -- Darren Duncan

Well, I wonder if there is an overflow bit that would
tell your is the number was going on and on after
you did an operation on it.

What would the practical value of that be? The only commonly used numeric types that have bits for tracking exceptional cases are IEEE floating point numbers, and it is already explicitly known that most typical operations producing results of that type are producing inexact rounded results. So if they are already expected to be inexact or rounded, it doesn't matter if the exact answer would have been rational or irrational. -- Darren Duncan

Reply via email to