[Haskell-cafe] Difference between div and /
Maciej Piechotka
uzytkownik2 at gmail.com
Tue Jun 1 17:18:54 EDT 2010
On Tue, 2010-06-01 at 22:40 +0200, 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 :)
>
> What about this one:
> round (a/b/c) == round (a/(b*c))
>
> Of course this doesn't work on Integers...
>
Hmm. C, Java & co.[1] seems to not have this problem. Also having common
division operator is well - useful.
I don't think it would create much confusion. At least no more than IEEE
standard.
[1] By co I mean Ruby, Python, Perl and others. There are no so many
languages that do recognize the difference.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100601/c7a4e520/attachment.bin
More information about the Haskell-Cafe
mailing list