Convert variable to different data type
converts B
= cast(A
,newclass
)A
to the data type (class) newclass
, where
newclass
is the name of a built-in data type compatible with
A
. The cast
function truncates any values in
A
that are outside the range of newclass
to the
nearest endpoint.
When converting a floating-point number to an integer, the cast
function rounds the number to the nearest integer. If the floating-point number has a
fractional part of exactly 0.5, then it rounds away from zero to the integer with larger
magnitude.