[vorbis-dev] RE: vorbis under win32
macik
macik at europe.com
Tue Nov 16 01:50:45 PST 1999
> 4.)
>> I found different behaviour between gcc and msvc when dividing very small doubles (like 2.13e-312)
My fault, there was something I missed. I can't see "very small doubles (like 2.13e-312)" anymore. These "small doubles" are really true zeros.
So different behaviour is:
int val=rint(data[i]/curve[i]);
when curve[i] is zero then
in gcc:
val will become -(2^15)
in MSVC:
val will become 0
I'm surprised of this un-catched division by zero.
to avoid of this we can simply check
int val;
if (curve[i]==0) {
val=-16; // emulate gcc behaviour or
// val=0; // emulate msvc behaviour
}
else {
val=rint(data[i]/curve[i]);
if(val>16)val=16;
if(val<-16)val=-16;
};
For now all inconsistencies are solved and win32 code produces exactly the same bitstreams like linux code (Im curious of VQ code).
bye
macik
(eof)
__________________________________________________
FREE Email for ALL! Sign up at http://www.mail.com
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
More information about the Vorbis-dev
mailing list