Re: int2interval, frac2interval, rat2interval
On 2012-04-20 16:22:39 +0100, N.M. Maclaren wrote:
> 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.
That's the goal of Motion 33: let the implementation decide what can
be used for the number format(s).
> >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.
OK, but I'm just saying that num2interval() would be dangerous
on such an arithmetic, like on any arithmetic with approximate
computations (e.g. floating-point), as said in the previous
discussions on num2interval(). The user can still use the less
ambiguous nums2interval(), hoping that he knows what he's doing.
> 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.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)