Mail Archives: djgpp/1996/12/13/07:40:08
Frank Frederiksen wrote:
>
> Hi there,
>
> In our research project we are transmitting some floating point
> numbers over a radio channel (the position of a mobile transmitter).
>
> Our problem is that we sometimes get bit errors, i.e., some of the
> bits in the numbers are wrong. When we analyze the data, we then
> sometimes get a 'exiting due to SIGFPE' followed by a stack trace.
>
> When we symify the program the first two lines are:
> __doprnt+1432
> _fprintf+105
>
> So, is there a (simple)way of detecting if a floating point number
> is legal, before printing it, or do we have to investigate the
> numbers individually to see if they are valid numbers?
>
Dig in the sources of libm, there are some functions
like isNAN, isInf and so on. But, this will give
you only a warning when the number is really junked.
You'd better look for CRC codes and such to trap
errors when the transmission failed but the number
happens to be valid, just off by some orders of magnitude.
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* Voice/Fax Box: +49 2561 91371 2056 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -