Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. Using Mathematical Operators > Rounding Floating-Point Numbers Up an...

recipe 3.10. Rounding Floating-Point Numbers Up and Down

3.10.1. Problem

You want the next smallest or largest integer value of a floating-point number (floor or ceil).

3.10.2. Solution

floor(x) returns the largest integral value that is not greater than x. ceil(x) returns the smallest integral value that is not less than x.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial