test if integer

Discussion in 'C++' started by laura, Aug 4, 2007.

  1. laura

    laura Guest

    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
    laura, Aug 4, 2007
    #1
    1. Advertising

  2. * 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?
    Alf P. Steinbach, Aug 4, 2007
    #2
    1. Advertising

  3. laura

    Ian Collins Guest

    laura wrote:
    > Hi,
    >

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

    --
    Ian Collins.
    Ian Collins, Aug 4, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    CType(x,Integer) vs. Integer.Parse(x)

    =?Utf-8?B?Sm9l?=, Feb 6, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    5,948
    =?Utf-8?B?RGF2aWQgQW50b24=?=
    Feb 7, 2006
  2. =?ISO-8859-1?Q?Thomas_Gagn=E9?=

    No Math.min(Integer, Integer)?

    =?ISO-8859-1?Q?Thomas_Gagn=E9?=, Jul 29, 2003, in forum: Java
    Replies:
    0
    Views:
    502
    =?ISO-8859-1?Q?Thomas_Gagn=E9?=
    Jul 29, 2003
  3. Sebastian Stelzer

    How do I add an Integer to another Integer?

    Sebastian Stelzer, Oct 14, 2004, in forum: Java
    Replies:
    2
    Views:
    490
    Yu SONG
    Oct 15, 2004
  4. Sebastian Stelzer

    How do I add an Integer to another Integer?

    Sebastian Stelzer, Oct 14, 2004, in forum: Java
    Replies:
    6
    Views:
    45,403
    JavaBean2010
    Apr 7, 2010
  5. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    693
    Skybuck Flying
    Oct 4, 2009
Loading...

Share This Page