converts val to the type type, for use in compiled code.
uses the specified casting method.
- Cast[value,type] reinterprets the bits representing val as having the type type.
- Cast is only available in compiled code.
- Possible values of method in Cast[val,type,method] include:
"BitCast" reinterprets the bits representing val as having the type type "CCast" emulates the behavior of casting in C
- Cast[val,type,"BitCast"] behaves as though val is written to memory and read back as type.
- Cast[val,type,"CCast"] only supports numeric types.
- The input type to a bitcast must be the same length as the output type.
Examplesopen allclose all
Basic Examples (2)
Wolfram Research (2022), Cast, Wolfram Language function, https://reference.wolfram.com/language/ref/Cast.html.
Wolfram Language. 2022. "Cast." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Cast.html.
Wolfram Language. (2022). Cast. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Cast.html