Re: 80 bit precision ?



Terry Reedy a écrit :
> [...]
> Last I read, in CPython, the float type encapsulates a C double.
> So, does any C compiler implements doubles as 80 bit floats?

I seriously doubt it.

> Or, if it has 64 bit
> doubles and 80 bit long doubles, are the latter transparently
> substitutible for the former, so that you could change Python's
> float declaration and have everything work as expected? (I an
> not sure of either.)

Mmmmmm ... the python C code implementing the math module is
probably not that polymorphic <wink>. Even a call to "sqrt"
does not work as expected if the argument is a long double.
"sqrtl" should be use instead.

Cheers,

SB

.



Relevant Pages

  • Re: why float
    ... A double *is* a float with more precision. ... It is possibly to do with spurious precision in the doubles - in numerical ... I think it depends on teh algorithm as well. ... single-precision in order to stop rounding errors from amplifying ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: increased machine precision for FreeBSD apps?
    ... > arithmetic (e.g. scientific computation apps for one, ... > rounding errors by increasing the data type size? ... Most programmers expect a float to be an IEEE 754 single-precision ... On most modern FPUs, however, floats, doubles, and sometimes even ...
    (freebsd-arch)
  • Re: how to use PI in c99
    ... if float operations are faster than doubles, ... more than 16 significant digits, or, whatever the relative ... i thought the compiler would optimize it and only use floats. ...
    (comp.lang.c)
  • Re: HPGCC related ...
    ... your suggestion about using the stack library. ... I am currently entering my variables as strings. ... having problems to display floats or doubles on screen. ... to print a float: ...
    (comp.sys.hp48)
  • Re: doubles or not
    ... > even a float can not be enough for this, we may need doubles. ... the point that you are missing is "..when integers will do". ... integer math. ...
    (microsoft.public.vc.language)