[E-Lang] Operators #6: Multiplicative operators
Mark S. Miller
markm@caplet.com
Tue, 10 Apr 2001 10:12:14 -0700
At 08:18 AM Tuesday 4/10/01, Karp, Alan wrote:
>Mark Miller wrote:
>>
>> x / y, when x and y are either integers or float64s, evaluates to the
>> floating point number that's the appropriate approximation to the real
>> quotient by the IEEE round-to-even rule (the rounding rule governing all
>> floating point arithmetic in Java and E.) When x and y are float64s, "/"
>> has the same meaning in E as in Java.
>I think there needs to be a way to control the IEEE rounding mode. It's
>particularly important when writing code to implement math functions like
>log, exp, etc. While I expect there to be library routines for these,
>special rounding modes are often used for computing special functions, such
>as Bessel functions and spherical harmonics.
Even once there's an ENative, E-on-pure-Java will continue to be one of the
important implementations of E, and may continue to be *the* important
implementation. As a result, E can only specify that which can be
reasonably implemented in standard pure Java. So regarding float64s and
IEEE, E conforms to "the deterministic subset of IEEE supported by standard
pure Java".
Is there any way in standard pure Java to control the rounding mode?
>Round-to-even is the proper
>default. By the way, this same statement on rounding is needed for +, -,
>and * as well.
Done.
Cheers,
--MarkM