[Numpy-tickets] [NumPy] #730: long doubles display differently than the other float types

NumPy numpy-tickets@scipy....
Wed Apr 9 18:09:54 CDT 2008

#730: long doubles display differently than the other float types
 Reporter:  charris  |        Owner:  somebody
     Type:  defect   |       Status:  new     
 Priority:  normal   |    Milestone:  1.0.5   
Component:  Other    |      Version:  none    
 Severity:  minor    |   Resolution:          
 Keywords:           |  
Comment (by charris):

 These values should really be determined at compile time, not hardwired in
 at lines 611-621 of scalartypes.inc.src. Maybe use the values in float.h,
 which on my machine give

 single digits 6
 double digits 15
 long double digits 18

 The current values we are using are 8, 17, and 22 whereas the values above
 are supposed to guarantee reversible conversion to and from decimal. Of
 course, that doesn't seem to be the case in practice, they seem to need at
 least one more digit. The other question is if all the common compilers
 support float.h

 The numbers above were generated by

 #include <float.h>
 #include <stdio.h>

 int main(int argc, char** argv)
     printf("single digits %d\n",FLT_DIG);
     printf("double digits %d\n",DBL_DIG);
     printf("long double digits %d\n",LDBL_DIG);

     return 1;


Ticket URL: <http://scipy.org/scipy/numpy/ticket/730#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.

More information about the Numpy-tickets mailing list