home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!network.ucsd.edu!ucsbcsl!ucsbuxa!6500mack
- From: 6500mack@ucsbuxa.ucsb.edu (Michael P. Mack)
- Newsgroups: comp.lang.c
- Subject: How is NaN recognized? (solved)
- Message-ID: <5585@ucsbcsl.ucsb.edu>
- Date: 1 Sep 92 02:05:08 GMT
- Sender: root@ucsbcsl.ucsb.edu
- Lines: 14
-
- Thanks for all the responses.
-
- The simplest solution to this problem was suggested by
- Larry Jones of SDRC (lawrence.jones@sdrc.com)
-
- By checking the return value of scanf(), it is easy to
- tell when it has failed:
-
- if (scanf("%f",&value) == EOF)
- value = 0.0;
-
-
- Mike
-
-