TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"Robert I. Eachus" <[log in to unmask]>
Reply To:
Robert I. Eachus
Fri, 29 Oct 1999 19:23:57 -0400
text/plain (20 lines)
At 04:48 PM 10/29/1999 -0400, Ben Brosgol wrote:
>>> 3) Java uses IEEE 754 for floating point semantics.
>>Java *specifies* IEEE 754.  Most implementations just use whatever
>>the hardware provides.  Ada implementations also use whatever the
>>hardware provides, so this difference is really a bit of a red herring.
>So be it.  I was going by the language spec, not current implementation

   Actually, the correct answer is more that Java includes the IEEE rules by reference.  While Ada needs, and has, a more complete model--when in the Annex G strict mode.  I could go on at length about the differences, but I and others have at great length--including Robert Dewar and the NRG.  There are two types of differences on 32-bit machines.  The first type are those where the IEEE-rules give different answers based on rounding modes or Ada provides an interval in terms of model intervals, but the standards are compatible.  These are only of interest to a very small set of people.  The other class is those where for example the IEEE standard allows setting rounding modes and multiple NaNs, but Ada requires specific rounding modes, and has exceptions in place of signalling NaNs.  These do reflect an implementation freedom in Ada that is a user freedom in Java.  But then again, if you do flip those bits in your program, all bets are off.

   In any case, Ada and Java are very compatible, while C is very far away.  (The biggest differences of course is the lack of exceptions in C.  But the pain in analysis occurs where C requires extending certain single operands to double, while IEEE and Ada specify accuracy in terms of the operand type.)

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...