H.Holone$B$G$9!#e(B
ruby1.8e$B$K$*$$$F!"0J2<$N!Ve(BMarshale$B$Ge(B dumpe$B$7$Fe(B
loade$B$7$FLa$9!We(B
codee$B$GIT0lCW$r0UL#$9$k$$$/$D$+$N?tCM$,I=<($5$l$^$9!#e(B
$ cat ~/tmp/test.rb
srand(1)
1000000.times do
f = rand(0)
fm = Marshal.dump(f)
if Marshal.load(fm) != f then
p fm, f
end
end
$ ./ruby ~/tmp/test.rb
“\004\bf\e2.2971038112107323e-05”
2.29710381121073e-05
“\004\bf\e0.00012889203743071675”
0.000128892037430717
“\004\bf\e1.2080800923408574e-05”
1.20808009234086e-05
“\004\bf\e0.00016731992938723295”
0.000167319929387233
“\004\bf\e0.00015761288904592163”
0.000157612889045922
“\004\bf\0320.0017032264342446979”
0.0017032264342447
“\004\bf\e0.91493880848429388\000\377\377”
0.914938808484294
“\004\bf\0270.1635388066770247”
0.163538806677025
“\004\bf\0320.0018947760614906883”
0.00189477606149069
“\004\bf\0310.015573558744790716”
0.0155735587447907
ruby1.9e$B$K$*$$$F$O<j6a$G;n$7$?HO0O$G$OLdBj$"$j$^$;$se(B
(e$B2?$bI=<($5$l$^$;$se(B)e$B!#e(B
e$B!!;n$7$Ke(B Marshale$BJ8;zNs$re(B stdlibe$B$Ne(B strtod()
e$B$G>.?t$KLa$7$Fe(B
e$B$$?$H$3$m!"8m:9$N$J$$85$N?tCM$KLa$j$^$7$?$N$G!"e(B1.8
e$B$N8=9T$Ne(B ruby_strtod()e$B$N@:EYITB-$@$H;W$$$^$9!#e(B
e$B!!e(B1.9e$B$Ne(B ruby_strtod()e$B$OJLJ*$K$J$C$F$$$k$h$&$G$9$N$Ge(B
1.8e$B$N$$N>I>u$J$N$O$=$3$,M}M3$J$N$@$H;W$$$^$9!#e(B
backporte$B$O0l=V9M$($?$N$G$9$,!"e(B1.9e$B$Ne(B ruby_strtod()e$B$Oe(B
e$B0l8+$5$s$N;d$K$O87$7$$$N$G!"e(Bdefinee$B$^$o$j$N0UL#$re(B
e$BM}2r$7$F$$$kJ}$K$*4j$$$7$^$9!De(B
H.Holon [ e$B%i!<%@$C$]$$9ue(B75e$B$N2He(B | http://radastery.jp/ ]