TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MATHIEU BOUCHARD
from: ERIK WARMELINK
date: 1997-08-26 04:56:00
subject: converting sound data

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.