Page 1 of 1

PostPosted: Thu Feb 08, 2001 7:58 pm
by jjenkins
Does any library function exist to convert a 16-bit 2's complement number to a floating point number?
Any C or C++ library exist that I could try to compile in PocketC?

PostPosted: Fri Feb 09, 2001 7:45 pm
by jstadolnik
float conv(int a) {
//sign extend if 16 bit number if negetive
if(a&0x8000) a=a|0xffff0000;

That's it.