Navigation

Operators and Keywords

Function List:

C++ API

: cast (val, "type")

Convert val to data type type.

val must be one of the numeric classes:

"double"
"single"
"logical"
"char"
"int8"
"int16"
"int32"
"int64"
"uint8"
"uint16"
"uint32"
"uint64"

The value val may be modified to fit within the range of the new type.

Examples:

cast (-5, "uint8")
   ⇒ 0
cast (300, "int8")
   ⇒ 127

See also: typecast, int8, uint8, int16, uint16, int32, uint32, int64, uint64, double, single, logical, char, class, typeinfo.

Package: octave