Num

Purpose: A double cast as a number.

num( <var> )

num returns the truncated value of a double <var>, as a number.

This is different from trunc() in that trunc() returns a double value. If your goal is to obtain a number from a double value where the decimal part is removed, use num(); if you want the same but the result should be a double, use trunc().

If you wish to get a number from a double by some other method, consider floor(), ceil() and round() (all of which return a double) and then apply num() to the result.
Examples
set-double d = num(1.2) + 1

See also
Math functions
abd  
abn  
acos  
acosh  
asin  
asinh  
atan  
atan2  
atanh  
cbrt  
ceil  
copysign  
cos  
cosh  
dbl  
erf  
erfc  
exp  
exp2  
floor  
fmod  
hypot  
isinf  
isnan  
ldexp  
lgamma  
log  
log10  
log2  
math-functions  
nextafter  
num  
pow  
round  
sin  
sinh  
sqrt  
tan  
tanh  
trunc  
See all
documentation


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.