Using the ciel() function

This is a discussion on Using the ciel() function within the C++ Programming forums, part of the General Programming Boards category; I am trying to figure out what I am doing wrong. I have included cmath. I want to round the ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    36

    Using the ciel() function

    I am trying to figure out what I am doing wrong. I have included cmath.

    I want to round the value of a double to the next whole number using the ciel function and store that value in a integer. This is what I have.

    Example:

    Code:
    int wholeScore;
    
    double preciseScore = 7.33;
    
    wholeScore = int ciel( preciseScore )
    The error is type int unexpected. If I do it like this:

    Code:
    wholeScore = ciel( preciseScore )
    I get error ciel undeclared identifier.

    Thanks for your help!

    JLH
    Last edited by jlharrison; 07-07-2006 at 10:14 AM.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    "i before e except after c" comes to mind. If spelling isn't your strong suit, the good news is that any reference will probably get it right.
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    36
    OMG Thanks

    I feel so dumb.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 02:01 AM
  3. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 07:54 PM
  4. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  5. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 07:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21