# Code Review: numeric types

**URL:** <https://www.ruby-forum.com/t/code-review-numeric-types/161480>\
**Category:** IronRuby\
**Created:** [February 26, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/code-review-numeric-types/161480 "2009-02-26T21:00:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [February 26, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/code-review-numeric-types/161480/1 "2009-02-26T21:00:44Z")

</div>

tfpt review “/shelveset:num;REDMOND\sborde”

Comment :  
Fixnum + Bignum should yield a Bignum, not a Float. This was causing  
complex/denominator\_spec to fail as Bignum was monkey-patched and not  
Float. A different return type affects whether the monkey-patched method  
is visible or not. Also changed fixnum/plus\_spec to check for the result  
type.  
BigDecimal coercing works a bit differently. So added a protocol for  
that.  
Small change to the MSpec eql guard to show the type of actual and  
expected values since the inspect string itself can be identical.

Tomas, I had added tests for Enumerable#each\_cons each\_slice. Let me  
know if you want to grab them since you are working on the fix. Else, I  
can check it in with tags (will need to move it from library/enumerator  
to core/enumerable).

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [February 26, 2009, 10:41pm UTC](https://www.ruby-forum.com/t/code-review-numeric-types/161480/2 "2009-02-26T22:41:45Z")

</div>

Looks good.

Tomas
