More seriously, are there really no case in Julia like that :

*Return float for negative b, integer otherwise ⟹ not type-stable.*


? 

Otherwise, a better solution is to return Rational for negative, and Int 
for positive. Always returning Rational is not cool because we use positive 
numbers more often than negative ones.
In this way, *a^b would always return an exact result of the operation*. 
 These operations belong to arithmetic on integer numbers, and "rounding" 
has nothing to do here !
If i had a code performing some calculations on integer numbers, I would be 
sad to discover a Float in the output in the case when I forgot to handle 
the negative integers.

In this spirit, 

*10^-2.0*

 
is not the good reflex to have : it should be 

*(10//1)^-2*

Reply via email to