mruby/mruby — pull request #1907 by ksss (2014-03-21 14:59:18+00:00)
Title: Float#round fix bug for infinity and nan cases

Current is like that.

```ruby
> inf = 1.0/0.0
=> inf
> inf.round
=> -2147483648
> inf.round(-1)
=> -2147483648
> inf.round(1)
=> inf
> nan = 0.0/0.0
=> NaN
> nan.round
=> -2147483648
> nan.round(-1)
=> -2147483648
> nan.round(1)
=> NaN
> 42.0.round(306)
=> 42.0
> 42.0.round(307)
=> inf
> 1.0e307.round(1)
=> 1.0e+307
> 1.0e307.round(2)
=> inf
```

I think it's should be like that.

```ruby
> inf = 1.0/0.0
=> inf
> inf.round
(mirb):1: Infinity (FloatDomainError)
> inf.round(-1)
(mirb):1: Infinity (FloatDomainError)
> inf.round(1)
=> inf
> nan = 0.0/0.0
=> NaN
> nan.round
(mirb):1: NaN (FloatDomainError)
> nan.round(-1)
(mirb):1: NaN (FloatDomainError)
> nan.round(1)
=> NaN
> 42.0.round(306)
=> 42.0
> 42.0.round(307)
=> 42.0
> 1.0e307.round(1)
=> 1.0e+307
> 1.0e307.round(2)
=> 1.0e+307
```