[erlang-questions] Flooring integer division in Erlang?
Igor Ribeiro Sucupira
Sat Apr 26 19:37:01 CEST 2008
Are you just in need of some (any) high-level implementation? Or
you're after some really efficient operator?
On Sat, Apr 26, 2008 at 12:49 PM, Dimitry Golubovsky
> Is there any Erlang library around that contains an integer division
> function that rounds negative quotient down (towards negative
> infunity, flooring division)?
> I am trying to implement Haskell-style division which for
> (-5) `div` (3) yields -2
> while Erlang's (-5) div (3) yields -1
> PS The Erlang specification (rather old, of 1999
> http://www.erlang.org/download/erl_spec47.ps.gz), mentions on page 15
> that at some moment, operations // and mod were added, which round to
> negative infinity (as oposite to div and rem). Were these ever
> Dimitry Golubovsky
> Anywhere on the Web
More information about the erlang-questions