www.delorie.com/gnu/docs/elisp-manual-21/elisp_64.html   search  
 
Buy the book!


GNU Emacs Lisp Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7 Rounding Operations

The functions ffloor, fceiling, fround, and ftruncate take a floating point argument and return a floating point result whose value is a nearby integer. ffloor returns the nearest integer below; fceiling, the nearest integer above; ftruncate, the nearest integer in the direction towards zero; fround, the nearest integer.

Function: ffloor float
This function rounds float to the next lower integral value, and returns that value as a floating point number.

Function: fceiling float
This function rounds float to the next higher integral value, and returns that value as a floating point number.

Function: ftruncate float
This function rounds float towards zero to an integral value, and returns that value as a floating point number.

Function: fround float
This function rounds float to the nearest integral value, and returns that value as a floating point number.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003