This is fix2float.c in view mode; [Download] [Up]
#include <stdio.h>
main( int argc, char *argv[] ) {
short s ;
float f, fac = 1./32767. ;
if ( isatty(1) == 1 ) {
fprintf( stderr, "%s\n",
"fix2float usage: fix2float < 16-bit_fixed > binary_floats " ) ;
exit( -1 ) ;
}
while( fread( &s, sizeof(short), 1, stdin ) != 0 ) {
f = s ;
f *= fac ;
fwrite( &f, sizeof(float), 1, stdout ) ;
}
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.