Re: motion 24.03
> Subject: Re: motion 24.03
> From: Marco Nehmeier <nehmeier@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> Date: Wed, 20 Jul 2011 20:41:23 +0200
> Cc: stds-1788@xxxxxxxxxxxxxxxxx
> To: Dan Zuras Intervals <intervals08@xxxxxxxxxxxxxx>
>
>
> Am 20.07.2011 um 18:33 schrieb Dan Zuras Intervals:
>
> >> . . .
> >>
> >> If your answer for Q1 is (d1) and (u1) than we exclude =
> implementations
> >> in programming languages without support for directed rounding, e.g. =
> all
> >> Java VM based languages (Java, Scala, Groovy, Clojure ...) or pure
> >> (standard) and platform independent C++ (to my knowledge the still
> >> current C++03 standard did not define support for switching the =
> rounding
> >> mode. Commonly the switching of the rounding mode is done in C++ =
> using
> >> the C99 header fenv.h if supported, or with inline assembler.)
> >
> > I am unfamiliar with most of the languages on your list
> > but I think you will find that both Java & C++ already
> > support basic arithmetic with directed roundings.
> >
> > You will have to ask someone else about Java
>
> No, floating point operations are settled to round to nearest for the =
> Java VM, see
> Java VM Specification Section 3.8.1 Java Virtual Machine Floating-Point =
> Arithmetic and IEEE 754
> =
> http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html=
I am not discussing playing with the rounding mode.
Indeed, I would have no idea how to do that in Java
&, even if I did, it would seem to be against the
principles of Java itself.
No, I refer to making calls to the routines Prof
Kulisch desires in his motion.
And I am pretty sure that if you look carefully you
will find some open & standard library that contains
exactly those calls.
>
>
>
>
> > but in C++,
> > they are supported via the means of standard math library
> > function calls.
>
> to my knowledge the only possible ways to address the rounding mode in =
> C++ by using the C99
> header fenv.h or to use inline assembler. The first method is not =
> defined in the C++03 standard and the
> second approach is a platform dependent way... Hence I can not find a =
> specification in the current C++ standard
> to set the rounding mode for floating point operations.
>
>
> Marco
>
>
> >
> >>
> >> . . .
> >>
Again, this has nothing to do with playing with the
rounding mode. It has to do with calling a standard
library function that implements a basic operation
with a directed rounding.
Now it may be that the library function in question
implements the desired operation VIA THE MEANS of
changing the rounding mode & changing it back again.
But that fact is forever hidden from the user's view
of the 'system' by being wrapped up within the call
itself.
Indeed, that is the thrust of Prof Kulisch's motion.
Well, that & the hope that it will find efficient
implementation in hardware someday.
Dan