[Curious] Integer division => fraction

Karl Ramberg karl.ramberg at chello.se
Thu Jun 12 21:35:57 UTC 2003



Andreas Raab wrote:
> 
> Hi Guys,
> 
> Just had an interesting discussion with Dean (over on e-Lang) about integer
> division semantics. He pointed out (and I agree) that most people tend to
> find it it confusing that "3/4" results in a fraction rather than coercing
> to Float by default.
> 
> My questions: What do you think about this issue? Are you personally
> surprised if you get a fraction back? Has it bitten you in unexpected
> places? Have you actually ever had the need for coercing to fractions
> instead of floats? Can you think of "typical" applications that would be
> harmed by coercing to floats?
> 
> Thanks for any info you can share.
> 
I'v mostly been bitten by fractions in points. Points do not like
fractions: why ?
It would be nice if classes that don't like fractions would convert the 
fraction to float or integers as needed, and not bug the user about 
this kind of stuff.

Karl



More information about the Squeak-dev mailing list