% operator with negatives

Russell Crook rmc at nixtdc.uucp
Fri Dec 14 01:27:01 AEST 1990


Even more disturbing about the / ambiguity... 
If I interpret the ANSI standard correctly, there is no guarantee that
   (-a)/b == a/(-b)
where a and b are positive (e.g., 14 and 10).
It appears to be legal for the rounding direction to vary arbitrarily
even on one machine when / and negative numbers are involved.
Yecch.

It would have been nice to have / more tightly defined, but (alas)
reality intrudes.
We have to work with several systems, and the preferred
rounding direction does indeed vary between them.
And yes, we got bitten by it :-< :-< .

-- 
------------------------------------------------------------------------------
Russell Crook, Siemens Nixdorf Information Systems, Toronto Development Centre
2235 Sheppard Ave. E., Willowdale, Ontario, Canada M2J 5B5
Ph: +1 416 496 8510      Fax: +1 416 496 8534



More information about the Comp.lang.c mailing list