RE: [Dev-C++] Checking validity of float and double
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2002-05-01 14:10:30
|
here is a idea initalize your variables when you declare them eg float var_name = 0.0; thus you can test for for 0 to see if the values have changed. > From: dev...@li... > [mailto:dev...@li...] On > Behalf Of Glen > Corby > Sent: Friday, April 26, 2002 12:49 PM > To: dev...@li... > Subject: [Dev-C++] Checking validity of float and double > > > This isnt a dev-C++ specific question, but i am wondering > if anyone > knows how you check if a float or double carrys valid > data. > > My program runs fine most of the time but every now and > again it spits > out -NaN. > I figure its from uninitialised variables, however I cant > track down > where they enter the program without performing periodick > checks at > suspect locations. > > So is there a function like > bool validFloat(float num) for instance? ===== David Mcken Life Sucks Live with it __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com |