Re: Numeric Semantics

2007-01-15 Thread Smylers
TSa writes: > Looks like we need a host of division function pairs: > > fdiv fmodflooring division > ediv emodeuclidean division > rdiv rmodrounding division > tdiv tmodtruncating division > cdiv cmodceiling division That depends on exactly what you mean by "we" and

Re: Numeric Semantics

2007-01-15 Thread TSa
HaloO, I wrote: I cannot give an algorithm how to calculate the remainder. Even less do I know how to generalize it to full Complex. Since one wants the absolute value of the remainder less than the absolute value of the divisor the float result is *rounded* in the real and imaginary component

Re: Numeric Semantics

2007-01-15 Thread TSa
HaloO, Mark J. Reed wrote: I believe mod should be defined in the conventional way: x mod y = x - floor(x/y) * y, which does yield 0.8 for 3.2 mod 2.4. However, for 3.2 mod - 2.4 it yields -1.6. To get 0.8 you would have to round toward zero instead of taking the floor, and that complicates an