From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: Q: detecting valid floating point numbers? Date: 9 Dec 1996 16:02:06 GMT Organization: Cornell University Lines: 25 Sender: asu1 AT cornell DOT edu (Verified) Message-ID: <58hd5u$t5t@newsstand.cit.cornell.edu> References: <58gvqc$26p AT newsfeed DOT cs DOT auc DOT dk> NNTP-Posting-Host: 128 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp ff AT kom DOT auc DOT dk (Frank Frederiksen) wrote: > >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? > i would assume that if trying to print a floating point number gives an error, the comparison you would make would also be unreliable. i would concentrate my effort on making sure the receiving program accepts only uncorrupted data. this does not mean examining individual numbers but using some sort of mechanism (like checksums) to ensure the integrity of the data your receive, and do a re-transmit if necessary. i am no expert on the subject. i recall that the author of kermit had a very good article which might prove to be useful. it was in dr dobbs journal (http://www.ddj..com) (if you need the reference, i can try to find the magazine.) sinan.