Qu

to_int

Builtin index · Collections & strings

result = to_int(x)

Input: x · Output: result

What it is

x is a number, or a Str that parses as one. Rounds to the nearest whole number, ties away from zero — the same primitive round uses, so the two agree by construction rather than by coincidence. MATLAB's int32 rounds; C's cast truncates; this rounds, and says so. A string that is not a number is a clear error, never a silent 0.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = to_int(x)
x number, Str, or stringnot documented yet
result Num
Returns a Num.

Examples

No documentation example calls this form yet. The Collections & strings chapter is where one belongs.