Feb 21, 2002 #1 BM Programmer Apr 26, 2000 27 GB Hi all, Anyone know a good clean way of extracting a FLOAT type number from four bytes in byte array? Thanks. Barry
Hi all, Anyone know a good clean way of extracting a FLOAT type number from four bytes in byte array? Thanks. Barry
Feb 22, 2002 1 #2 Zyrenthian Programmer Mar 30, 2001 1,440 US well... assuming that the byte array has the appropriate format of the bits try union itof{ int i; float f; }; itof myItoF; set the 4 bytes of the int in myItoF to the 4 bytes you have and then look at f Matt Upvote 0 Downvote
well... assuming that the byte array has the appropriate format of the bits try union itof{ int i; float f; }; itof myItoF; set the 4 bytes of the int in myItoF to the 4 bytes you have and then look at f Matt
Feb 22, 2002 Thread starter #3 BM Programmer Apr 26, 2000 27 GB Hi Matt, thanks for the reply, I will try that Barry Upvote 0 Downvote
Feb 22, 2002 #4 michaelkrauklis Programmer Dec 5, 2001 226 US Good call Z MYenigmaSELF:-9 myenigmaself@yahoo.com http://myenigmaself.gaiden.com"If debugging is the process of removing bugs, then programming must be the process of putting them in." --Dykstra Upvote 0 Downvote
Good call Z MYenigmaSELF:-9 myenigmaself@yahoo.com http://myenigmaself.gaiden.com"If debugging is the process of removing bugs, then programming must be the process of putting them in." --Dykstra