Haskell doesn't expose / to integers. only mod and rem. / is only exposed to rationals and reals.
On Thu, Apr 25, 2013 at 7:52 AM, Diggory Hardy <[email protected]> wrote: > > My opinion (that nobody will follow, but I still give it) is that > integers > > should not have the "/" operator at all. This was one of the bad choices > of > > C (or maybe of a previous language). > > Hmm, maybe, though I can imagine plenty of people being surprised at that. > > What really gets me though is that % is commonly called the "mod" operator > and > yet has nothing to do with modular arithmatic (I actually wrote a blog post > about it a few months back: [1]). If it were my choice I'd either make "x > % y" > do real modular arithmatic (possibly even throwing if y is not positive) or > have no % operator (just mod and rem keywords). > > [1]: > http://diggoryhardy.wordpress.com/2013/01/08/why-division-remainder-and-modulus-are-not-the-same/ > > -Diggory > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
