[Bug #1720] [NaN] == [NaN] が true になる

Bug #1720: [NaN] == [NaN] e$B$,e(B true e$B$K$J$ke(B
http://redmine.ruby-lang.org/issues/show/1720

e$B5/I<<Te(B: tadayoshi funaba
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
Target version: 1.9.x
ruby -v: ruby 1.9.2dev (2009-07-03 trunk 23945) [i686-linux]

NaN = 0.0/0
[NaN] == [NaN] e$B$,e(B true e$B$K$J$j$^$9$,!"e(B

NaN == NaN #=> false
[1] == [1.0] #=> true

e$B$H$$$&7k2L$+$i$9$k$H$*$+$7$$$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:38725] [Bug #1720] [NaN] == [NaN] e$B$,e(B
true e$B$K$J$ke(B
on Fri, 3 Jul 2009 21:43:24 +0900, tadayoshi funaba
[email protected] writes:

|NaN = 0.0/0
|[NaN] == [NaN] e$B$,e(B true e$B$K$J$j$^$9$,!"e(B
|
|NaN == NaN #=> false
|[1] == [1.0] #=> true
|
|e$B$H$$$&7k2L$+$i$9$k$H$*$+$7$$$h$&$K;W$$$^$9!#e(B

e$B3N$+$K!#e(Brb_equal()e$B$,N>JU$,F1$8%%V%8%%/%H$N$H$-$K%a%=%C%I8Fe(B
e$B$S=P$7$r9T$o$:$K??$rJV$7$F$$$k$;$$$G$9$M!#e(BNaNe$B$H$$$&$N$O!"e(B
equal?e$B$,@.N)$7$F$be(B==e$B$,@.N)$7$J$$$H$$$&FC0[$J%
%V%8%%/%H$G$"e(B
e$B$k$?$a$K$3$NLdBj$,H/@8$7$F$$$^$9!#e(B

e$B$H$O$$$(!"$3$s$JFC<[email protected]%A%%C%/$rCY$/$7$?$/$Je(B
e$B$$$7!":$$C$?$b$N$G$9!#e(B

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

In message Re: [ruby-dev:38734] Re: [Bug #1720] [NaN] == [NaN]
e$B$,e(B true e$B$K$J$ke(B
on Sun, 5 Jul 2009 01:14:16 +0900, Yukihiro M.
[email protected] writes:

||NaN = 0.0/0
||[NaN] == [NaN] e$B$,e(B true e$B$K$J$j$^$9$,!"e(B
||
||NaN == NaN #=> false
||[1] == [1.0] #=> true
||
||e$B$H$$$&7k2L$+$i$9$k$H$$+$7$$$h$&$K;W$$$^$9!#e(B
|
|e$B3N$+$K!#e(Brb_equal()e$B$,N>JU$,F1$8%
%V%8%%/%H$N$H$-$K%a%=%C%I8Fe(B
|e$B$S=P$7$r9T$o$:$K??$rJV$7$F$$$k$;$$$G$9$M!#e(BNaNe$B$H$$$&$N$O!"e(B
|equal?e$B$,@.N)$7$F$be(B==e$B$,@.N)$7$J$$$H$$$&FC0[$J%*%V%8%%/%H$G$"e(B
|e$B$k$?$a$K$3$NLdBj$,H/@8$7$F$$$^$9!#e(B

e$B9M$($i$l$kBP=h$Oe(B

(1) NaN == NaN e$B$be(B true e$B$K$9$ke(B
[email protected]$O$"$k$,e(B NaN e$B$NK\Mh$N5sF0$G$O$J$$e(B
(2) rb_equal()e$B$G$^$:e(Bequal?e$B$G$N%A%%C%/$r$d$a$ke(B
[email protected]=$,Nt2=$9$k$N$GHr$1$?$$e(B
(3) rb_equal()e$B$Ge(BT_FLOATe$B$rFCJL07$$e(B
2e$B$[[email protected]=Nt2=$,5$$K$J$ke(B
e$BFCJL07$$$O8e2y$9$k$3$H$,B?$$e(B
(4) e$B$3$N$^$^!#$3$l$ONc30E*$J%1!<%9$H$9$ke(B

e$B$/$i$$$G$7$g$&$+!#e(B

e$B;d<+?H$O!"$I$l$,NI$$$H$$$&0U8+$r8=;[email protected]$G$O;}$?$J$$$N$G$9$,!"e(B
e$B$I$l$,9%[email protected]$o$l$l$P!"e(B(1)e$B$,9%$-$G$9!#e(B

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev:38735] the message: [ruby-dev:38735] Re: [Bug #1720]
[NaN] == [NaN] e$B$,e(B true e$B$K$J$ke(B, on Jul/05 01:31(JST)
Yukihiro
Matsumoto writes:

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

(1) NaN == NaN e$B$be(B true e$B$K$9$ke(B
[email protected]$O$"$k$,e(B NaN e$B$NK\Mh$N5sF0$G$O$J$$e(B
(2) rb_equal()e$B$G$^$:e(Bequal?e$B$G$N%A%%C%/$r$d$a$ke(B
[email protected]=$,Nt2=$9$k$N$GHr$1$?$$e(B
(3) rb_equal()e$B$Ge(BT_FLOATe$B$rFCJL07$$e(B
2e$B$[[email protected]=Nt2=$,5$$K$J$ke(B
e$BFCJL07$$$O8e2y$9$k$3$H$,B?$$e(B
(4) e$B$3$N$^$^!#$3$l$ONc30E*$J%1!<%9$H$9$ke(B

e$B;d<+?H$O!"$I$l$,NI$$$H$$$&0U8+$r8=;[email protected]$G$O;}$?$J$$$N$G$9$,!"e(B
e$B$I$l$,9%[email protected]$o$l$l$P!"e(B(1)e$B$,9%$-$G$9!#e(B

e$B$o$?$7$be(B, (1)e$B$N$h$&$J5$$,$7$^$9e(B.

e$B$H$$$&$+e(B, (1)e$B$G$9$+e(B:

(1)
nan1 = 0.0/0
nan2 = 0.0/0

e$B$H$7$Fe(B,

nan1 == nan1 => true
nan1 == nan2 => false

e$B8=9T$G$Oe(B,

nan1.equal?(nan1)

e$B$J$N$Ke(B,

nan1 == nan1 => false

e$B$H$J$k$N$Oe(B,e$B%%V%8%%/%H;X8~E$K$+$J$j5$J,$N0-$$;[email protected]$H;W$$$^$9e(B.
nan1
e$B$He([email protected]$H$7$F$h$$$H;W$$$^$9e(B.

 [email protected]$O$"$k$,e(B NaN e$B$NK\Mh$N5sF0$G$O$J$$e(B

e$B$H$"$j$^$9$,e(B, e$B$=$l$K4X$7$F$Oe(B nan1 == nan2 => false
e$B$K$J$l$PLdBj$J$$$-e(B
e$B$,$7$^$9e(B.

__
---------------------------------------------------->> [email protected](B
e$B7=<ye(B <<
---------------------------------->> e-mail: [email protected] <<

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