3 ms·
It would be 'weak' typing if Ruby ran an integer routine on a raw mantissa|significand value. Ruby is effectively doing type-checks on every operation, and that
by blasdel 17y ago
It would be 'weak' typing if Ruby ran an integer routine on a raw mantissa|significand value. Ruby is effectively doing type-checks on every operation, and that can never be 'weak'
What you're complaining about is that it has a numeric tower, but does not have anything like type-classes.
- kscaldef 17y agoNo, I'm complaining that it has implicit type coercions, which is one flavor of weak typing. (I suppose, I would also complain that it does implicit coercions in a way which results in loss of precision.)
- arohner 17y agoThe problem is that ruby implicitly casts in a way that loses precision, exactly the opposite of what the author (may) desire. Call it whatever you want. 2**100 => 1267650600228229401496703205376 > (2**100).class => Bignum > (2**100)*0.5 => 6.33825300114115e+29 > ((2**100)*0.5).class => Float