lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> Then you are in for a lot of pain ;-> as it seems C99 mandates
> rounding division towards zero ( previously it was imp-def-beh ).

C does that mainly because that is what most (all?) CPUs do. CPUs do
that because that division is the only one that respects the law
(-a)/b == a/(-b) == -(a/b), which simplifies the hardware. (It can
always divide positive integers and apply the proper signal to the

-- Roberto