Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   test if integer (http://www.velocityreviews.com/forums/t526907-test-if-integer.html)

laura 08-04-2007 06:49 AM

test if integer
 
Hi,

I have a variable of type double.
I need to know if there is an integer number store there. How can I
test that ?

I also have a default precision for doing this operation.

Many thanks,
Laura


Alf P. Steinbach 08-04-2007 06:55 AM

Re: test if integer
 
* laura:
>
> I have a variable of type double.
> I need to know if there is an integer number store there. How can I
> test that ?


You can always check the value x against floor(x).


> I also have a default precision for doing this operation.


And what does that mean?

Anyways, chances are that the same advice as above, is relevant.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Ian Collins 08-04-2007 11:13 AM

Re: test if integer
 
laura wrote:
> Hi,
>

Please don't multi-post, your question has been answered elsewhere.

--
Ian Collins.


All times are GMT. The time now is 04:07 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.