Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes


includes main-level program

top source mg_trunc

result = mg_trunc(x)

Truncate argument towards 0.0, i.e., takes the FLOOR of positive values and the CEIL of negative values.

Return value

array of same type as argument


x in required type=float/double

array containing values to truncate


Try the main-level program at the end of this file. It does:

IDL> print, mg_trunc([1.2, -1.2, 0.0]) 1 -1 0 IDL> print, floor([1.2, -1.2, 0.0]) 1 -2 0 IDL> print, ceil([1.2, -1.2, 0.0]) 2 -1 0

File attributes

Modification date: Tue Sep 13 16:50:08 2011
Lines: 42
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.