Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: int2interval, frac2interval, rat2interval



On Apr 20 2012, Vincent Lefevre wrote:
On 2012-04-20 08:31:05 -0500, Ralph Baker Kearfott wrote:

But "rational" data types, to my knowledge, have not been included
in arithmetic standards in the past, so we'd have more work defining
what we meant.  (In contrast, for example, both binary floating point
and decimal data types are defined in 754-2008, so our standard could
relate to one or more of those.)

I sincerely hope that it isn't going to depend on them, or preserve
their known flaws.  But it depends a lot on what you mean by arithmetic
standards - rational data types are well understood, though I agree
that there isn't anything obvious to refer to.

Yes, there's the risk that the rational arithmetic is implemented
with rounding errors if the type has bounded numerator and denominator
values (I think I've seen that somewhere).

I have implemented it, too.  It's got some solid theory behind it,
and is little more difficult to specify than indefinite precision
rationals.  Several people toyed with the idea of implementing a
version of Fortran using it (which was permitted before Fortran 90),
but I don't know if anyone did.  Search on "fixed slash" if you are
interested.

Whether anyone wants to bother with it is another matter - the main
purpose for which it strikes me as best suited is desk and pocket
calculators.  Not exactly a major market, nowadays :-)

Regards,
Nick Maclaren.