Mathieu, 21 Aug you wrote to me:
MB>> i'd rather do:
MB>> x=(x+128)/256
EW> That's OK for signed values, not for unsigned's.
MB> eeegegeeeeehhhh???
MB> explain please. afaik, my method works for both signed &
MB> unsigned.
Thinking about it (I knew I had forgotten something ;-)), it is also
dangerous for signed values.
32767 + 128 == -32641, resulting in -127, not really close to 127.99609375.
OTOH using 32bit arithmetic, there's no problem.
Bye,
Erik
---
---------------
* Origin: WarmelinkE@vertis.nl (2:282/1.60)
|