e$BCf@n$H$$$$$^$9!#e(B
http://www.rubyist.net/~matz/20070803.html#p04
e$B$G8@5Z$5$l$F$$$k!“e(Bstrtod e$B$N@:EY$N7o$K$D$$$FDs0F$,$”$j$^$9!#e(B
2007-08-02 e$B$N%3%a%s%H$Ge(B shiro
e$B$5$s$,>R2p$7$F$$$?!“e(B
e$B!Ve(BHow to Read Floating Point Numbers Accurately
(1990)e$B!W$Ne(B2004e$BG/HGe(B
http://portal.acm.org/citation.cfm?id=989430&dl=&coll=&CFID=15151515&CFTOKEN=6184618
e$B$K!”$3$N%“%k%4%j%:%`$re(B David Gay
e$B$,<BAu$7$?$H$$$&5-=R$,$”$j$^$9!#e(B
e$B$=$N<BAu$N:G?7HG$O!"$*$=$i$/!“e(Bhttp://netlib.sandia.gov/fp/dtoa.c.gz
e$B$@$He(B
e$B;W$&$N$G$9$,!”$3$N<BAu$re(B ruby
e$BK\BN$K<h$j9~$`$3$H$rDs0F$7$^$9!#e(B
e$B;n$7$K$3$l$re(B ruby 1.8 e$B$KAH$9~$s$G$$^$7$?!#e(B
$ uname -mrs
Darwin 8.10.1 i386
$ ./ruby -v
ruby 1.8.6 (2007-08-20 patchlevel 5000) [i686-darwin8.10.1]
e$BAH$_9~$_A0e(B:
$ ./ruby -e ‘printf(“%21.0f\n”, 36893488147419107329.0)’
36893488147419103232
e$BAH$_9~$_8ee(B:
$ ./ruby -e ‘printf(“%21.0f\n”, 36893488147419107329.0)’
36893488147419111424
e$B7k2L$O!":G6aK5CM$X$N4]$a$K$J$C$F$$$k$3$H$,$o$+$j$^$9!#e(B
PHP e$B$K$D$$$F!"e(B5.2.3 e$B$N%=!<%9%3!<%I$r3NG’$7$F$_$?$H$3$m!"e(B
zend_strtod.c e$B$O!"e(BDavid M. Gay e$B$Ne(B dtoa.c e$B$r2~NIe(B(ARM
e$BBP1~$J$I$rDI2Ce(B)
e$B$7$?$b$N$N$h$&$G$9!#e(B
e$BB>$K$b!"e(BECMA-262 2nd edition e$B$Ne(B 9.8.1 e$B$Ge(B
Implementors of ECMAScript may find useful the paper and code written
by
David M. Gay for binary-to-decimal conversion of floating-point
numbers:
e$B$H$$$&5-:$,$"$C$?$j!"e(B
Mac OS X 10.4.10 e$B$Ne(B man 3 strtod e$B$N:G8e$Ke(B
AUTHORS
The author of this software is David M. Gay.
e$B$H$$$&5-:$,$“$k$N$G!”$=$l$J$j$K%a%8%c!<$J<BAu$N$h$&$G$9!#e(B
e$B%i%$%;%s%9E*$K$b!"e(B
- The author of this software is David M. Gay.
- Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
- Permission to use, copy, modify, and distribute this software for any
- purpose without fee is hereby granted, provided that this entire
notice - is included in all copies of any software which is or includes a copy
- or modification of this software and in all copies of the supporting
- documentation for such software.
e$B$H!“e(Bmissing/strtod.c e$B$N%i%$%;%s%9$H$”$^$jJQ$o$i$J$$$N$G!“e(B
LEGAL
e$B$N5-=R$r:9$7BX$($kDxEY$G:Q$`$H;W$&$N$G$9$,!”$$$+$,$G$7$g$&$+!#e(B