On Tuesday 01 June 2010 22:40:51, Jonas Almström Duregård wrote:
> >> One might expect a == (a/b)*b and other common arithmetic formulas to
> >> hold for division?
> >
> > Better not if one's using Float or Double.
>
> I figured someone would say that :)

*g*

>
> What about this one:
> round (a/b/c) == round (a/(b*c))

Don't know, we have
(a `quot` b) `quot` c == a `quot` (b*c)
for Integers (overflow may or may not break that for Int), so if (/) were 
truncating division for Integral types, we'd have that.

I like the distinction between (/) and div (and quot), but I have no 
problem using (/) for integer division in Python, C, Java or C#.

>
> Of course this doesn't work on Integers...
>
> /J
>
> On 1 June 2010 21:08, Daniel Fischer <[email protected]> wrote:
> > On Tuesday 01 June 2010 20:26:55, Jonas Almström Duregård wrote:
> >> One might expect a == (a/b)*b and other common arithmetic formulas to
> >> hold for division?
> >>
> >> /Jonas
> >
> > Better not if one's using Float or Double.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to