Trunk: BigDecimal#<=> $B$,ITDjCM$rJV$9>l9g$,$"$k(B

pegacorn e$B$G$9!#e(B

BigDecimal#<=> e$B$,ITDjCM$rJV$9>l9g$,$"$j$^$9!#e(B

% ruby -rbigdecimal -e ‘p BigDecimal(“1.0”) <=> “”’
8

Index: ext/bigdecimal/bigdecimal.c

— ext/bigdecimal/bigdecimal.c (e$B%j%S%8%g%se(B 16197)
+++ ext/bigdecimal/bigdecimal.c (e$B:n6H%3%T!<e(B)
@@ -730,12 +730,13 @@

switch(op)
{

  • case '’: return INT2FIX(e); / any op */
  • case ‘*’: f = rb_intern("<=>"); break;
    case ‘=’: f = rb_intern("=="); break;
    case ‘!’: f = rb_intern("!="); break;
    case ‘G’: f = rb_intern(">="); break;
    case ‘L’: f = rb_intern("<="); break;
    case ‘>’: case ‘<’: f = (ID)op; break;
  • default: rb_bug(“Undefined operation in BigDecimalCmp()”);
    }
    return rb_num_coerce_cmp(self,r,f);
    }

e$B$J$s$Ge(B ‘*’ e$B$,e(B any op e$B$J$N$+$o$+$j$^$;$s$,!"e(B

+ case '’: return Qnil; / any op */

e$B$O0c$&$7!De(B

pegacorn e$B$G$9!#e(B

From: pegacorn [email protected]
Date: Sat, 26 Apr 2008 23:54:57 +0900
Message-Id: [email protected]
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BigDecimal#<=> e$B$,ITDjCM$rJV$9>l9g$,$"$j$^$9!#e(B

% ruby -rbigdecimal -e ‘p BigDecimal(“1.0”) <=> “”’
8

r18162 e$B$NJQ99$G!"$3$N%1!<%9$OLdBj$J$/$J$j$^$9$,!"e(B
e$BB>$N%1!<%9$,$^$:$/$J$C$F$$$k$N$G$O$J$$$G$7$g$&$+!#e(B

% ruby -v
ruby 1.9.0 (2008-07-27 revision 18230) [i386-freebsd7.0]
% ruby -rbigdecimal -e ‘p BigDecimal(“1.0”) <=> “”’
nil
% ruby -rbigdecimal -e ‘p BigDecimal(“1.0”) <=> 1.0’
nil

% ./ruby -v
ruby 1.9.0 (2008-07-22 revision 18161) [i386-freebsd7.0]
% ruby -rbigdecimal -e ‘p BigDecimal(“1.0”) <=> 1.0’
0

From: pegacorn [email protected]
Date: Sat, 26 Apr 2008 23:54:57 +0900
Message-Id: [email protected]
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~