[REBOL] Type inconsistency in Arithmetic Functions
From: pwawood::gmail at: 11-Aug-2007 12:04
I feel the following behaviour is inconsistent:
>> type? 2 + 2
== integer!
>> type? 2 - 2
== integer!
>> type? 2 * 2
== integer!
>> type? 2 / 2
== integer!
>> type? 2 ** 2
== decimal!
Both Python seems to return an integer:
>>> 2 ** 2
4
>>> 2.0 ** 2
4.0
As does Ruby:
irb(main):002:0> 2 ** 2
4
irb(main):004:0> 2.0 ** 2
4.0
Does anybody know if this is by design or is simply a consequence of
the current implementation?
Regards
Peter