Re: [linux-audio-dev] Converting float to int

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Converting float to int
From: martijn sipkema (msipkema_AT_sipkema-digital.com)
Date: Mon Oct 29 2001 - 23:34:03 EET


> Well, I was assuming that it was really +-1.0f is 0dB(internal), so >1.0
> or <-1.0 is possible, and I though that SHRT_MIN != -SHRT_MAX (though K&R
> seem to disagree, pp. 257). I guess I've forgotten how 2's complement
> works.

for 2's complement SHRT_MIN would be one larger than SHRT_MAX, but
i don't think you should depend on signed integers being 2's complement.
with
1's complement SHRT_MIN == -SHRT_MAX.

--martijn


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Oct 29 2001 - 22:53:13 EET