Strtod mail protected]:EY(B

[email protected]$H$$$$$^$9!#e(B

http://www.rubyist.net/~matz/20070803.html#p04
[email protected]$5$l$F$$$k!“e(Bstrtod [email protected]:EY$N7o$K$D$$$FDs0F$,$”$j$^$9!#e(B

http://d.hatena.ne.jp/hnw/20070802 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
[email protected]$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 © 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

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31539] strtod [email protected]:EYe(B”
on Mon, 20 Aug 2007 23:32:48 +0900, Satoshi N.
[email protected] writes:

|http://www.rubyist.net/~matz/20070803.html#p04
|[email protected]$5$l$F$$$k!“e(Bstrtod [email protected]:EY$N7o$K$D$$$FDs0F$,$”$j$^$9!#e(B
|
|http://d.hatena.ne.jp/hnw/20070802 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 [email protected]$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

e$B$=$N$h$&$JDs0F$rBT$C$F$$$^$7$?!#$^$:!“e(B1.9e$B$G:n6H$7$?$$$H;W$$e(B
e$B$^$9$,!”>e$N%U%!%$%k$rCV$-49$([email protected]$1$G:n6H$O40N;$G$9$+!)e(B

[email protected]$G$9!#e(B

e$B$=$N$h$&$JDs0F$rBT$C$F$$$^$7$?!#$^$:!“e(B1.9e$B$G:n6H$7$?$$$H;W$$e(B
e$B$^$9$,!”>e$N%U%!%$%k$rCV$-49$([email protected]$1$G:n6H$O40N;$G$9$+!)e(B

e$B<j85$N4D6-$G!"e(B1.9
e$B$KAH$9~$s$G$$?$H$3$m!"LdBj$J$/F0:n$7$F$$$k$h$&$G$9!#e(B

$ uname -mrs
Darwin 8.10.1 i386
$ ./ruby -v
ruby 1.9.0 (2007-08-20 patchlevel 0) [i686-darwin8.10.1]
$ ./ruby -e ‘printf("%21.0f\n", 36893488147419107329.0)’
36893488147419111424

e$B9T$C$?:n6H$O0J2<$NDL$j$G$9!#e(B

e$B!&e(Butil.c e$B$Ne(B ruby_strtod e$B$re(B dtoa.c
e$B$N<BAu$GCV$-49$($ke(B
e$B!!e(B(dtoa.c e$B$Oe(B http://netlib.sandia.gov/fp/dtoa.c.gz
e$B$r;HMQe(B)

e$B!&CV$-49$($?<BAu$N:G=i$N$[$&$Ge(B endian [email protected]_Dje(B

#ifdef BIG_ENDIAN
#define IEEE_MC68k
#else
#define IEEE_8087
#endif

e$BB>$KI,MW$H;W$o$l$k:n6H$O!"0J2<$NDL$j$G$9!#e(B

e$B!&e(Bbig endian e$B4D6-$G$NF0:n3NG’e(B ([email protected]|!"e(BPPC
e$B4D6-$G$d$j$^$9e(B)

e$B!&e(BVAX e$BBP1~$HF0:n3NG’e(B

#ifdef vax
#define VAX
#undef IEEE_MC68k
#undef IEEE_8087
#endif

e$B!&e(BARM e$BBP1~$HF0:n3NG’e(B

PHP e$B$Ne(B zend_strtod.c e$B$K$h$k$H!"e(BARM e$B$Ne(B FPU e$B$Oe(B
byte order e$B$,e(B little endiane$B!"e(Bword order e$B$,e(B big endian
e$B$J$N$G!"e(B

#if defined(arm) && !defined(VFP_FP)
#define IEEE_MC68k
#undef IEEE_8087
#endif

e$B$rDI2C$7$F!"e(B
dtoa.c e$B$Ne(B 293e$B9TL$Ke(B

-#if defined(IEEE_8087) + defined(VAX)
+#if defined(IEEE_8087) + defined(VAX) + defined(arm)

e$B$N$h$&$J%Q%C%A$rEv$F$kI,MW$,$"$k$h$&$G$9!#e(B

e$BB>$K!"e(Bdtoa.c e$B$,FbIt$GMxMQ$7$F$$$ke(B endian e$B$Ne(B define
e$BL>$,e(B

IEEE_8087 e$B"*e(B little endian
IEEE_MC68k e$B"*e(B big endian

e$B$J$N$G$9$,!"$3$NL>A0$O8m2r$N85$J$N$G!"e(B

#define IEEE_LITTLE_ENDIAN
#define IEEE_BIG_ENDIAN

e$B$N$h$&$KCV$-49$($?J}$,$h$5$=$&$G$9!#e(B

[email protected]$G$9!#e(B

On 2007/08/21, at 2:03, Tanaka A. wrote:

without fee e$B$H$"$j$^$9$,!"$=$l$C$Fe(B ruby e$B$rGd$C$F$O$$$1$J$/$Je(B
e$B$k!"$H$$$&$3$H$G$7$g$&$+e(B?

e$BG0$N$?$a!":n<T$NJ}$K<q;][email protected]@$7$F?V$$$F$_$^$7$?!#e(B
e$BA4J8$r0J2<$K0zMQ$7$^$9!#e(B

By the way, for other variants of IEEE arithmetic and similar
arithmetics, a generalization is available in /netlib/fp/gdtoa.tgz,
e.g., http://netlib.sandia.gov/fp/gdtoa.tgz .

– Dave

e$B$H$N$3$H$J$N$G!"e(B(e$B>/$J$/$H$be(B dtoa.c e$B$K$D$$$F$Oe(B)
e$BBg>[email protected]$H;W$$$^$9!#e(B

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

e$B;d$be(Blawyere$B$G$O$"$j$^$;$s!#e(B

Tanaka A. wrote:

e$B$H$$$&$+!“e(Bmissing/strtod.c e$B$be(B without fee e$B$H$”$j$^$9$+$i!"$9e(B
e$B$G$KGd$C$F$O$$$1$J$$e(B?

e$BGd$C$F$O$$$1$J$$$b$N!"$HG’<1$7$F$$$^$7$?!#e(B

LEGALe$B$N=q$-MM$r8+$k$H!Je(Bwith the file
itselfe$B!K!"!V$G$b%P%$%J%j$J$i4X78$Je(B
e$B$$$h$M!W$H$$$&$^$D$b$H$5$s$N5$;}$A$,;G$($^$9$,!"$5$F$I$&$+!#e(B

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRspATh9L2jg5EEGlAQLruQf/bBEXPZnxkiBUsegU7/EVlUkt7Ro89fUQ
Fr5ViHScFgHg9jUuH8BM2Op2fEZNSQeknlRFRpxhvWA5cThwZ53bKjPHJvbpv7pW
v+akXrswkvdaPTZHsvd/WyJLa5meg4fLajwF5G/F/8AWIvPHXrTr7stBFr2fnY6s
weiPR5aWf7/kMQVrXTELJ/1CuTqCNaxtpIG4rePYYlBrxBozv61mMHQFz90pzHBB
+uKUUZFW3ChnuBbNZePBU6cusBvVYc4z8fkJtLtmpIAGrrT3Otz1NH5dLOia/ZNQ
dhQTxe46yy3BhwA+DnhmjlWXl+P6oYySAzd21vM+m8xn8euQgX/Aug==
=3eGR
-----END PGP SIGNATURE-----

In article [email protected],
Satoshi N. [email protected] writes:

  • 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

without fee e$B$H$"$j$^$9$,!"$=$l$C$Fe(B ruby e$B$rGd$C$F$O$$$1$J$/$Je(B
e$B$k!"$H$$$&$3$H$G$7$g$&$+e(B?

e$B$H$$$&$+!“e(Bmissing/strtod.c e$B$be(B without fee
e$B$H$”$j$^$9$+$i!"$9e(B
e$B$G$KGd$C$F$O$$$1$J$$e(B?

e$B$J$K$+!"FI$_4V0c$($F$$$k$G$7$g$&$+!#e(B

((e$B$3$N%=%U%H%&%’%"$re(B(e$BG$0U$NL\E*$Ge(B(e$B;HMQe(B|e$BJ#@=e(B|e$BJQ99e(B|e$B$^$?$OG[I[e(B))
e$B$9$k$?$a$Ne(B)(e$BL5NA$N5v2De(B))e$B$Oe(B(provided
thate$B0J2<$N>r7oe(B)e$B$,K~$?$5$l$ke(B
e$B8B$j$K$*$$$F$3$3$K>5Bz$5$l$k!#e(B

e$B$H$$$&0UL#[email protected]$H;W$$$^$9$h!#e(Bwithout
feee$B$J$N$Oe(Bpermissione$B$rM?$($k$3$H!#e(B

In article [email protected],
Satoshi N. [email protected] writes:

without fee e$B$H$"$j$^$9$,!"$=$l$C$Fe(B ruby e$B$rGd$C$F$O$$$1$J$/$Je(B
e$B$k!"$H$$$&$3$H$G$7$g$&$+e(B?

e$BG0$N$?$a!":n<T$NJ}$K<q;][email protected]@$7$F?V$$$F$_$^$7$?!#e(B
e$BA4J8$r0J2<$K0zMQ$7$^$9!#e(B

e$B$"$j$,$H$&$4$6$$$^$9!#:n<T$NJ}$N0U?^$O$o$+$j$^$7$?!#e(B

e$B$H$9$k$H!";d$NFI$_J}$,4V0c$C$F$$$k$H$$$&[email protected]$H;W$&e(B
e$B$N$G$9$,!“FI$D>$7$F$$F$b$d$C$Q$j$=$&$OFI$a$^$;$s!#J[8n;N$,e(B
e$B$I$&$3$&$H$$$&%l%Y%k$G$J$/!”[email protected]$i$+$KGd$C$F$O$$$1$J$$$He(B
e$BFI$a$F$7$^$$$^$9!#$I$J$?$+$3$N1QJ8$NFI$_J}$r65$([email protected]$1$Je(B
e$B$$$G$7$g$&$+!#e(B

  • 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;d$,Lu$9$H<!$N$h$&$K$J$C$F$7$^$$$^$9!#e(B

e$BG$0U$NL\E*$KL5NA$G$3$N%=%U%H%&%’%"$r;HMQ!“J#@=!“JQ99!“G[I[$9e(B e$B$k5v2D$O!”$3$N5-=RA4BN$,$3$N%=%U%H%&%’%”$NJ#@=$^[email protected]$,4^e(B e$B$^$l$kG$0U$N%=%U%H%&%’%”$N$9$Y$F$NJ#@=$*$h$S$=$N%=%U%H%&%'e(B e$B%"$N%5%]!<%H%I%-%e%a%s%H$N$9$Y$F$NJ#@=$K4^$^$l$k8B$j$K$*$$$Fe(B
e$B>5Bz$5$l$k!#e(B

e$BL5NA$G$J$$OC$K$D$$$F$O?($l$F$$$J$$$h$&$K;W$($k$N$G!“e(B
without fee e$B$r$I$&2r<a$9$l$P!”:n<T$NJ}$N0U?^$N$h$&$K$J$k$N$+e(B
e$B$o$+$j$^$;$s!#e(B

[email protected]@%$G$9!#e(B

e$BK!N’2H$G$O$"$j$^$;$s$,[email protected]$N$G0BA4B&$K?6$C$F$*$-$^$9$H!"e(B

  • The author of this software is David M. Gay.
  • Copyright © 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.

http://www.opensource.org/licenses/historical.php
e$B$N%F%s%W%l!<%H$K$=$C$?%i%$%;%s%9$N$h$&$G$9$,!"J8LL$H$7$F$O!“e(B
if the permission statement was included
if without fee
permit any purpose of use etc.
end
end
e$B$G$”$C$F!"e(Belse [email protected]@5Z$5$l$F$$$J$$$h$&$K46$8$i$l$^$9!#e(B

e$B$7$+$7!“Cx:n8”$K$*$$$F$O86B’Cx:n8"<T$,J#@=8"[email protected]$7$F$$$^$9$N$G!“e(B
e$B%i%$%;%s%9$NJ8>O$N$$G$OM-=~$N>l9g$O5vBz$5$l$F$$$J$$>uBV$H$J$j$^$9!#e(B
e$B$D$^$j!“Cx:n8”<T$OJ#@=8"Ey$r9T;H$G$-$k$H9M$($k$Y$-$G$7$g$&!#e(B
e$B!VHNGd6X;
!W$H$$$&[email protected]$,$”$k$N$G$9$,!"$^$!$=$&$$$&[email protected]$H;W$$$^$9!#e(B

e$B:#2s$Oe(B ruby-dev:31554 e$B$G:n<T$NJ}$+$ie(B no bearing
[email protected]$re(B
[email protected]$$$F$$$^$9$+$iLdBj$O$J$$$G$7$g$&$,!"e(B
e$B:r:#$Ne(B Ruby e$B$r<h$j4,$/4D6-$r9MN8$7$^$9$H!“e(B
e$BCx:n8"I=<($O;D$7$?>e$G!”%i%$%;%s%9$Oe(B Ruby License / GPL
e$B$G$NG[I[$re(B
[email protected]$$$?J}$,K>$^$7$/;W$$$^$9!#e(B

In article [email protected],
“NARUSE, Yui” [email protected] writes:

e$B$7$+$7!“Cx:n8”$K$*$$$F$O86B’Cx:n8"<T$,J#@=8"[email protected]$7$F$$$^$9$N$G!“e(B
e$B%i%$%;%s%9$NJ8>O$N$$G$OM-=~$N>l9g$O5vBz$5$l$F$$$J$$>uBV$H$J$j$^$9!#e(B
e$B$D$^$j!“Cx:n8”<T$OJ#@=8"Ey$r9T;H$G$-$k$H9M$($k$Y$-$G$7$g$&!#e(B
e$B!VHNGd6X;
!W$H$$$&[email protected]$,$”$k$N$G$9$,!"$^$!$=$&$$$&[email protected]$H;W$$$^$9!#e(B

e$B$"!"$O$$!#$9$$$^$;$s!#HNGd$9$k$K$OCx:n8"<T$N5v2D$,e(B (e$B$3$N%i%$e(B
e$B%;%s%9$H$OJL$Ke(B) e$BI,MW$H$J$k!"$H$$$&0UL#$G$9!#$G$-$J$$$H$$$&$Ne(B
[email protected]$$2a$.$G$7$?!#<+M3$K$O$G$-$J$$!"$H$$$&$3$H$rI=8=$7$?$+$Ce(B
e$B$?$H;W$C$F$d$C$F$/[email protected]$5$$!#e(B

In message [email protected]
on Tue, 21 Aug 2007 10:47:18 +0900,
Tanaka A. [email protected] wrote:

e$B$"$j$,$H$&$4$6$$$^$9!#:n<T$NJ}$N0U?^$O$o$+$j$^$7$?!#e(B

e$B$H$9$k$H!";d$NFI$_J}$,4V0c$C$F$$$k$H$$$&[email protected]$H;W$&e(B
e$B$N$G$9$,!“FI$D>$7$F$$F$b$d$C$Q$j$=$&$OFI$a$^$;$s!#J[8n;N$,e(B
e$B$I$&$3$&$H$$$&%l%Y%k$G$J$/!”[email protected]$i$+$KGd$C$F$O$$$1$J$$$He(B
e$BFI$a$F$7$^$$$^$9!#$I$J$?$+$3$N1QJ8$NFI$_J}$r65$([email protected]$1$Je(B
e$B;d$K$b!"$=$&FI$a$^$9!#e(B

e$BL5NA$G$J$$OC$K$D$$$F$O?($l$F$$$J$$$h$&$K;W$($k$N$G!“e(B
without fee e$B$r$I$&2r<a$9$l$P!”:n<T$NJ}$N0U?^$N$h$&$K$J$k$N$+e(B
e$B$o$+$j$^$;$s!#e(B
e$B$^$5$K!"e(BOpenBSDe$B$,e(BISCe$B$Ne(BNTPe$B$r<N$F$?860x$H0l=o$N=q$-J}$KFI$a$^$9!#e(B

This file is automatically generated from html/copyright.html

Copyright Notice

jpg “Clone me,” says Dolly sheepishly

Last update: 20:31 UTC Saturday, January 06, 2007
_________________________________________________________________

The following copyright notice applies to all files collectively
called the Network Time Protocol Version 4 Distribution. Unless
specifically declared otherwise in an individual file, this notice
applies as if the text was explicitly included in the file.


  • Copyright © David L. Mills 1992-2007 *
  •                                                                 *
    
  • Permission to use, copy, modify, and distribute this software and *
  • its documentation for any purpose with or without fee is hereby *
  • granted, provided that the above copyright notice appears in all *
  • copies and that both the copyright notice and this permission *
  • notice appear in supporting documentation, and that the name *
  • University of Delaware not be used in advertising or publicity *
  • pertaining to distribution of the software without specific, *
  • written prior permission. The University of Delaware makes no *
  • representations about the suitability this software for any *
  • purpose. It is provided “as is” without express or implied *
  • warranty. *
  •                                                                 *
    

The following individuals contributed in part to the Network Time
Protocol Distribution Version 4 and are acknowledged as authors of
this work.
(e$B0J2<N,e(B)

In message “Re: [ruby-dev:31558] Re: strtod [email protected]:EYe(B”
on Tue, 21 Aug 2007 11:00:27 +0900, Urabe S.
[email protected] writes:
|
|((e$B$3$N%=%U%H%&%’%"$re(B(e$BG$0U$NL\E*$Ge(B(e$B;HMQe(B|e$BJ#@=e(B|e$BJQ99e(B|e$B$^$?$OG[I[e(B))
|e$B$9$k$?$a$Ne(B)(e$BL5NA$N5v2De(B))e$B$Oe(B(provided thate$B0J2<$N>r7oe(B)e$B$,K~$?$5$l$ke(B
|e$B8B$j$K$*$$$F$3$3$K>5Bz$5$l$k!#e(B
|
|e$B$H$$$&0UL#[email protected]$H;W$$$^$9$h!#e(Bwithout feee$B$J$N$Oe(Bpermissione$B$rM?$($k$3$H!#e(B

[email protected]$5$s$,Ld$$9g$o$;$F$/[email protected]$5$C$?$*JV;v$G$"$ke(B

I am not a lawyer, but as far as I know, use of dtoa.c has no bearing
on whether or how you can sell the Ruby interpreter. I hope that is
clear from the permission statement you quoted. You just need to
keep that permission statement in the source file (dtoa.c).

e$B$rFI$`$H!Ve(Buse of dtoa.c has no bearing on whether or how you
can sell the Ruby interpreter. I hope that is clear from
the permission statement you [email protected]$=$&$G$9$+$i!“9gM}E*e(B
e$B$J2r<a$O!”$&$i$Y$/$s$N2r<aDL$j!Ve(Bwithout
feee$B!W$O!Ve(Bgrantede$B!W$Ke(B
[email protected]$H;W$$$^$9!#>/$J$/$H$be(Bdtoa.ce$B$K4X$9$k8B$j$O!#e(B

中川です。

1.9 用のパッチを作成しましたので、添付します。
既存の util.c の ruby_strtod を置き換える方針で作りましたが、
別ファイルのほうがよければ作り直します。

■パッチを作るために行った作業

http://netlib.sandia.gov/fp/dtoa.c.gz から取得した dtoa.c で
util.c の ruby_strtod の実装を置き換えた。

ä»¥ä¸‹ã‚’ç½®ãæ›ãˆãŸã‚³ãƒ¼ãƒ‰éƒ¨åˆ†ã®æœ€åˆã«è¿½åŠ ã€‚

#ifdef BIG_ENDIAN
#define IEEE_BIG_ENDIAN
#else
#define IEEE_LITTLE_ENDIAN
#endif

#ifdef vax
#define VAX
#undef IEEE_BIG_ENDIAN
#undef IEEE_LITTLE_ENDIAN
#endif

#if defined(arm) && !defined(VFP_FP)
#define IEEE_BIG_ENDIAN
#undef IEEE_LITTLE_ENDIAN
#endif

#undef Long
#undef ULong

#if SIZEOF_INT == 4
#define Long int
#define ULong unsigned int
#elif SIZEOF_LONG == 4
#define Long long int
#define ULong unsigned long int
#endif

#if defined(_MSC_VER) || defined(BORLANDC)
#define Long __int32
#define ULong unsigned __int32
#define IEEE_LITTLE_ENDIAN
#endif

コード中の little endian、big endian を示す define を可読性向上の
ために置き換えた。

IEEE_8087 → IEEE_LITTLE_ENDIAN
IEEE_MC68k → IEEE_BIG_ENDIAN

ARM 対応のため、Storeinc の定義部分で

-#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX)
+#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(arm)

のように変更した。

■動作確認

以下の環境で動作確認を行いました。

・Linux 2.6 (Debian etch) / Intel
・Mac OS X 10.4 / Intel
・Mac OS X 10.4 / PowerPC

・Linux 2.6 (Debian etch) / Intel

$ uname -mrs
Linux 2.6.18-4-686 i686
$ ./ruby -v
ruby 1.9.0 (2007-08-21 patchlevel 0) [i686-linux]
$ ./ruby -e ‘printf("%21.0f\n", 36893488147419107329.0)’
36893488147419111424

・Mac OS X 10.4 / Intel

$ uname -mrs
Darwin 8.10.1 i386
$ ./ruby -v
ruby 1.9.0 (2007-08-21 patchlevel 0) [i686-darwin8.10.1]
$ ./ruby -e ‘printf("%21.0f\n", 36893488147419107329.0)’
36893488147419111424

・Mac OS X 10.4 / PowerPC

$ uname -mrs
Darwin 8.10.0 Power Macintosh
$ ./ruby -v
ruby 1.9.0 (2007-08-21 patchlevel 0) [powerpc-darwin8.10.0]
$ ./ruby -e ‘printf("%21.0f\n", 36893488147419107329.0)’
36893488147419111424

■今後必要な作業

できるだけ多くの環境で動作確認を行う必要があります。
特に気になる環境は、以下の通りです。

・ARM

PHP の zend_strtod.c を参考に、一応対応したつもりですが、
実際に動作するかどうかわかりません。

・win32、win64、cygwin、mingw、bcc
・VAX

In article [email protected],
“NARUSE, Yui” [email protected] writes:

http://www.opensource.org/licenses/historical.php
e$B$N%F%s%W%l!<%H$K$=$C$?%i%$%;%s%9$N$h$&$G$9$,!"J8LL$H$7$F$O!"e(B

without fee e$B$NA0$Ke(B and e$B$,$"$k$H$+!“8eH>$bHyL/$K0c$&$H$+!”$$e(B
e$B$/$i$+0[$J$j$^$9$M!#e(B

e$BD4$Y$?$H$3$m!"$I$&$d$ie(B AT&T e$BH/[email protected];H$o$l$F$$$?%i%$%;%s%9$Ce(B
e$B$]$$$G$9!#e(B

e$B$?$H$($Pe(B SFIO e$B$O$^$C$?$/F1$8%i%$%;%s%[email protected]$C$?$i$7$/$F!"$=$l$re(B
Apache e$B$G$I$&$3$&$H$$$&[email protected]$,8+$D$+$j$^$7$?!#e(B

http://mail-archives.apache.org/mod_mbox/httpd-dev/199708.mbox/[email protected]>

e$B$d$C$Q$j!"$"$$$^$$$GG:$`$H$3$m$N$h$&$G$9!#e(B

[email protected]!";d$,;W$C$?$h$&$Je(B use, copy, modify and distribute e$B$Ke(B
without fee e$B$,$+$+$k$H$$$&2r<a$,EvA3$H$$$&$3$H$G$O$J$$$h$&$G!“e(B
permission e$B$K$+$+$k$H$$$&2r<a$b==J,$K$”$j$&$k46$8$G$9!#e(B
(granted e$B$K$+$+$k$H$$$&[email protected]$O=P$F$3$J$$e(B)

e$B$H$9$k$H!":n<T$N0U?^$b3NG’$7$?$7!"$^$!!"$3$N$^$^$G<h$j9~$s$Ge(B
e$B$bLdBj$J$5$=$&!"$H$$$&5$$,$7$F$-$^$7$?!#e(B

中川です。

On 2007/08/21, at 18:27, Yukihiro M. wrote:

が、この嫌がらせのようなインデントは直そうと思います。
なんなんだろ。タブがおかしい?

元にしたコードの閉じ括弧の位置が独特ですね。
インデントしなおして、soft tab 4 でパッチを作り直しました。
添付します。

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31567] Re: strtod [email protected]:EYe(B”
on Tue, 21 Aug 2007 16:45:43 +0900, Satoshi N.
[email protected] writes:

|1.9 e$BMQ$N%Q%C%A$r:[email protected]$7$^$7$?$N$G!"E:IU$7$^$9!#e(B
|e$B4{B8$Ne(B util.c e$B$Ne(B ruby_strtod e$B$rCV$-49$($kJ}?K$G:n$j$^$7$?$,!"e(B
|e$BJL%U%!%$%k$N$[$&$,$h$1$l$P:n$jD>$7$^$9!#e(B

e$B$3$l$Ge(BOKe$B$G$9!#<h$j9~$`J}?K$G!#e(B
e$B$,!"$3$N7y$,$i$;$N$h$&$J%$%s%G%s%H$OD>$=$&$H;W$$$^$9!#e(B
[email protected]$m!#%?%V$,$*$+$7$$!)e(B

e$B:#HUCY$/[email protected]|$NLk$K%3%_%C%H$7$^$9!#e(B

中川です。

On 2007/08/21, at 18:27, Yukihiro M. wrote:

が、この嫌がらせのようなインデントは直そうと思います。
なんなんだろ。タブがおかしい?

元にしたコードの閉じ括弧の位置が独特ですね。
インデントしなおして、soft tab 4 でパッチを作り直しました。
添付します。

何度もすみません。

eval.c を参考に、コーディングスタイルを合わせました。

・for、while、switch 直後に空白を入れた
・case のインデントを 2 に

こちらでお願いします。

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31582] Re: strtod [email protected]:EYe(B”
on Wed, 22 Aug 2007 01:12:29 +0900, Satoshi N.
[email protected] writes:

|eval.c e$B$r;29M$K!"%3!<%G%#%s%0%9%?%$%k$r9g$o$;$^$7$?!#e(B
|
|e$B!&e(Bfore$B!"e(Bwhilee$B!"e(Bswitch e$BD>8e$K6uGr$rF~$l$?e(B
|e$B!&e(Bcase e$B$N%$%s%G%s%H$re(B 2 e$B$Ke(B
|
|e$B$3$A$i$G$*4j$$$7$^$9!#e(B

e$B<h$j9~$_$^$7$?!#$"$j$,$H$&$4$6$$$^$9!#e(B
Rubye$B$G$OITMW$Je(BKR_headerse$B$de(BCONSTe$B$J$s$+$b:o$C$A$c$*$&$+$J$"!#e(B

In article [email protected],
Yukihiro M. [email protected] writes:

e$B<h$j9~$_$^$7$?!#$"$j$,$H$&$4$6$$$^$9!#e(B
Rubye$B$G$OITMW$Je(BKR_headerse$B$de(BCONSTe$B$J$s$+$b:o$C$A$c$*$&$+$J$"!#e(B

LEGAL e$B$K$OIU$12C$($k$s$G$7$g$&$+e(B?

e$B$"$H!";W$&$s$G$9$,!"e(Bmissing/strtod.c e$B$r!"e(B

  • e$B>C$9$+!"e(B
  • ruby_strtod e$B$r8F$S=P$9$h$&$K$9$k$+e(B
    e$B$I$A$i$+$K$9$k$H!"e(BLEGAL e$B$+$i:o$l$FHyL/[email protected]$,$A$g$C$H8:$i$;e(B
    e$B$FNI$$$h$&$K;W$$$^$9!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31588] Re: strtod [email protected]:EYe(B”
on Wed, 22 Aug 2007 11:36:28 +0900, Tanaka A. [email protected]
writes:

|LEGAL e$B$K$OIU$12C$($k$s$G$7$g$&$+e(B?

e$BIU$12C$($^$9!#e(B

|e$B$"$H!";W$&$s$G$9$,!"e(Bmissing/strtod.c e$B$r!"e(B
|* e$B>C$9$+!"e(B
|* ruby_strtod e$B$r8F$S=P$9$h$&$K$9$k$+e(B
|e$B$I$A$i$+$K$9$k$H!"e(BLEGAL e$B$+$i:o$l$FHyL/[email protected]$,$A$g$C$H8:$i$;e(B
|e$B$FNI$$$h$&$K;W$$$^$9!#e(B

e$B$3$l$b$7$h$&$H;W$C$F$^$7$?!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs