Posted on 2005-04-19
Last Modified: 2010-04-01
what is value for floor(4.9999)+ cel(2.0)
Question by:cuong5985
    LVL 30

    Expert Comment

    Hi cuong5985,

    Without know what is a floor, and waht is a cel, that question is difficult to answer.
    Please post the class declaration and implementation for an answer.

    David Maisonave :-)

    Author Comment

    i mean floor(4.9999) + ceil(2.0) i dont know what floor mean, but ceil is round up
    LVL 30

    Expert Comment

    >> mean floor(4.9999) + ceil(2.0) i dont know what floor mean, but ceil is round up

    Since floor is not part of the C++ standard, we can not answer your question without seeing the implementation.
    Post the code.
    LVL 16

    Accepted Solution

    floor rounds down so floor(4.9999) = 4
    ceil rounds up so ceil(2.0) = 2

    I will leave it up to you to calculate 4 + 2 ;)


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
    Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now