On Sunday, April 3, 2016 at 12:20:44 PM UTC-4, Stefan Karpinski wrote:
>
> I question the alleged ubiquity of integer division. This is not an 
> operation I find myself needing all that often. Of course, everyone's 
> programming needs are different, but I just don't find myself wanting the 
> integer quotient of a and b more often than I want to do a/b and get their 
> ratio as a float.
>

In my programming, I've rarely needed to get a floating point value from 
dividing two integers a and b, and there's another problem with the way 
that Julia handles it, in that, how do you control just what size float to 
return? Does it really make sense that an Int128 / Int128 produces a 
Float64?  To me, things like that make the automatic promotion of Integer / 
Integer to Float64 not very useful.
I'd rather be specific in my code, and have write Float64(a)/b, or 
BigFloat(a)/b, for the very few cases where I'd want a floating point 
result. (and since Julia has the wonderful Rationals, I'd rather use those 
than lossy floating point formats anyway).

Reply via email to