From: Tim Bradshaw on
On 2010-01-05 04:23:56 +0000, David Kirkby <drkirkby(a)gmail.com> said:

> True, but if you develop mathematical software, you need to check it.
> When you find something behaving differently on one platform to
> another, one needs to investigate that.

Yes, sorry, I wasn't particularly thinking you were wrong to worry!

From: Tim Bradshaw on
On 2010-01-05 00:03:37 +0000, "Richard B. Gilbert"
<rgilbert88(a)comcast.net> said:

> It is, of course, possible to do floating point operations using
> software emulation but most systems I've worked with did FP in hardware.
> Typically you could have 32 bit or 64 bit FP with 24 or 56 bits of
> precision. Any arbitrary precision is available in a software
> emulation but it would be dog slow on most hardware.

I'm pretty sure REDUCE has floating-point (really "inexact" would be a
better term) with user-defined precision. Mathematica certainly does:

N[E, 50]
2.7182818284590452353602874713526624977572470937000

CLISP, I think, has user-defined precision inexact floats in the language.

As you say, these things will be very slow compared with machine floats
on almost any hardware one can imagine. I'm guessing they have their
uses other than the obvious "show me 1000 digits of pi" type thing, or
people would not implement them. I'm guessing that, apart from
anything else they let you experiment with the sensitivity of numerical
algorithms to precision.

From: Uros Nedic on
I do not know which version of Solaris 10 you are using but there are all
updates SUN did so far for Solaris 10. Install all patches and try again to
compile.

Let me know what happened.

Uros

"David Kirkby" <drkirkby(a)gmail.com> wrote in message
news:c6cd81e8-c001-4be3-8312-af5371d93a83(a)r5g2000yqb.googlegroups.com...
On 2 Jan, 07:51, "Uros Nedic" <ur...(a)beotel.rs> wrote:
> On OpenSolaris for SPARC it works fine. I have even older version of
> SunStudio
> and here is the output:
>
> urosn(a)urosn:~$ uname -a
> SunOS urosn 5.11 snv_105 sun4v sparc SUNW,SPARC-Enterprise-T5120 Solaris
> urosn(a)urosn:~$ cat exp.c
> #include <math.h>
> #include <stdio.h>
> int main()
> {
> printf("%.16lf\n",exp(1.0));
>
> }
>
> urosn(a)urosn:~$ cc -lm exp.c
> urosn(a)urosn:~$ cc -V
> cc: Sun C 5.9 SunOS_sparc Patch 124867-11 2009/04/30
> usage: cc [ options] files. Use 'cc -flags' for details
> urosn(a)urosn:~$ ./a.out
> 2.7182818284590451
> urosn(a)urosn:~$
>
> It was error in SunStudio for Sparc at Solaris 10. In OpenSolaris it has
> been fixed.
>
> Regards,
> Uros Nedic


Are you saying the problem still exists on Solaris 10? If so, will the
fix be backported to Solaris 10? Are you aware of any patch for
Solaris 10? GCC has the same issue, but unfortunatley Sage will not
yet build with Sun Studio.

Does this replace the maths library, or is it just Sun Studio? I know
gcc has the exact same issue, though gcc will inline the code if its
very obvious exp() will be called with an argument of 1.0, but fails
if that is not known in advance. It may need a more complex program
than you posted to see this error.