/*
 *	Fix2float.c -- read integer values from stdin and 
 *		write floats onto stdout
 */

#include <stdio.h>

main(argc, argv) 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 ) ;
    }
}
