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

Re: Motion P1788/M0044:Constructors -- Voting Period begins - controlling rounding mode



BK>  To do so would require a facility for rounding the text value 0.1 down into the binary format and also rounding it up.
BK>  . . .
BK>  I don't think it is readily accessible by default in common programming languages.



The 1999 version of the C standard has functions to get and set the rounding mode.  They can be called from C++ or from Fortran.  Fortran also has its own IEEE modules which could be used.

For example. in an environment that supports changing the rounding mode (as opposed to having static rounding modes), a function something like the (completely untested) following should work.


- Ian McIntosh          IBM Canada Lab         Compiler Back End Support and Development


Inactive hide details for Baker Kearfott ---05/15/2013 10:45:58 AM---Richard et al, I'm not sure I understand your objection.  Baker Kearfott ---05/15/2013 10:45:58 AM---Richard et al, I'm not sure I understand your objection.  My perception is that


    From:

Baker Kearfott <rbk@xxxxxxxxxxxx>

    To:

Ian McIntosh/Toronto/IBM@IBMCA

    Date:

05/15/2013 10:45 AM

    Subject:

Re: Motion P1788/M0044:Constructors  -- Voting Period begins




Richard et al,

I'm not sure I understand your objection.  My perception is that
persons doing interval notation associate the text string 0.1
with the exact real number 1/10, and that any text2interval
conversion into a binary floating point system would have
to convert it into some non-zero-width interval with lower bound
and upper bound representable in the system and containing
the exact number 0.1.  To do so would require a facility
for rounding the text value 0.1 down into the binary format
and also rounding it up.  I know of packages that do this
(some of which are buggy), but I don't think it is readily
accessible by default in common programming languages.

How should we spell this out or clarify this?

Baker

On Sat, 11 May 2013 08:15:39 -0700
 Richard Fateman <fateman@xxxxxxxxxxxxxxxxx> wrote:
> The motion seems to be no more than changing the cross reference to
>the new location.
> I vote  YES.
>
> However, I would prefer that 1788 remove entirely text2interval...
>given that such issues
> as decimal-to-binary conversion, parsing and evaluation of exact
>arithmetic quotients,
> values for pi (etc),  are either routine parts of programming
>languages, or in their libraries.
>
> And to cap it off, this complicated and unnecessary part is (at
>least in the current motion) OPTIONAL.
>
> My view is that the host programming language must be adequate to
>create any literal number
> which is the inf or sup value stored in a bare interval, and to
>create from any bare interval
> the two numbers which are its inf and sup values  (including
>infinity, NaN).  If this is the
> case, there is no need for text2interval.    If this is NOT the
>case, the language is essentially
> unsuitable for interval arithmetic.  (A clever enough person could
>still build interval
> arithmetic out of character strings or some other hacks, but I would
>call this evidence of
> unsuitability...)
>
>Furthermore, text2interval violates what would seem to be a
>fundamental rule of "good hygiene".
> That is it admits of notation like 0.1 which is close, but not the
>same, in meaning as 0.1 in the programming
> language.
>
> Richard Fateman



GIF image

GIF image