On Jan 20, 5:15 pm, Luiz Felipe Martins <luizfelipe.mart...@gmail.com>
wrote:
> My understanding is that, since Python is based on C, it is IEEE-754
> compliant (as long as the CPU is, which I think is true for all the
> modern CPUs).

There are many ways of being "compliant" with IEEE-754.  If Sage is
supposed to get the same answers on any computer it runs on, then
IEEE-754 "compliant" is no assurance of anything.  Indeed, if Sage
must get the same floating point answers on every computer, it will
run substantially slower than it should, on some.  And get answers
that are less accurate.


>
> Jython might be a different story. (Which, I just learned, is alive
> and has a new version just released.)
>
> Also, I think the Java changed its floating-point support a while ago.

I mentioned that in my earlier note.

> From what I remember, the problem was that they wanted Java code to
> produce "exactly the same results" in all possible platforms, and in
> doing so, their floating-point became non-compliant.

Actually this is quite well described in Kahan/Darcy, and I think the
principal result is sort of the opposite.

That is, you can make programs that produce exactly the same result,
except it will slow down the fastest
computers, produce less accurate results than would otherwise be
obtained, and reduce various parts of
the environment to the least powerful. That's what you get for
"strictfp", and was the default behavior prior to
JVM 1.2 (according to wikipedia article).  Running strictfp makes some
(ordinarily much faster) Intel floating point
processors just as slow as Sun processors, and also makes the results
less accurate on Intel than would be ordinarily.
Both Sun and Intel are compliant in various senses, but note that the
IEEE-754 specifies the minimum number of bits in
registers for double-float exponents and fractions, not the maximum.


It may seem odd, but a programmer might want to have the best possible
results for each computer, even if it means
 DIFFERENT results on different computers.  This was what W. Kahan
convinced Bill Joy was the right thing to do.
I do not know if strictfp totally satisfied Kahan, or if it conforms
to Darcy's design of the "Borneo" language.

In my experience, people doing scientific calculations for a living
will not tolerate a language implementation X whose programs are
substantially slower than equivalent ones in a language implementation
Y.  (note that X and Y may be the same language but different
implementations!)  Comparing Java to Python but leaving out C is
therefore not terribly relevant.
(Except in scripting, GUI development, etc.)


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to