analysis/
mg_trunc.pro
includes main-level programtop 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
Parameters
- x in required type=float/double
array containing values to truncate
Examples
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 |
Contact me if you have enhancement requests or bug fixes.