ZVON > References > Haskell reference
| Indexes | Syntax | >> Prelude << | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Prelude
Function: truncate
Type: (RealFrac a, Integral b) => a -> b
Class: RealFrac
Description: returns the integer nearest argument between 0 and argument, inclusive
Related: ceiling, floor, properFraction, round
Keywords: truncation
MATHWORLD Truncate

Example 1

Input: truncate 1

Output: 1

Example 2

Input: truncate 1.3

Output: 1

Example 3

Input: truncate 1.7

Output: 1

Example 4

Input: truncate (-1.7)

Output: -1