"Real32" (Compiled Type)

"Real32"

represents an IEEE singleprecision real atomic type specifier.

Details

  • "Real32" can be used in Typed and related constructs to specify a type.

Properties

  • Values held by "Real32" range from -16^^.FFFFFF*^32 to 16^^.FFFFFF*^32.

Conversions

    From Expressions

  • Suitably sized Real expressions can be converted into compiled elements with the type "Real32".
  • To Expressions

  • Compiled elements with the type "Real32" can be converted into Real expressions.
  • Arithmetic

  • "Real32" compiled elements are automatically promoted to complex elements when they are combined in binary arithmetic operations.
  • "Real32" compiled elements are automatically promoted to "Real64" elements when they are combined in binary arithmetic operations.
  • Integers are automatically promoted to "Real32" when they are combined in binary arithmetic operations.

Runtime Errors

    Domain

  • "Real32" can give a runtime error if it is used in an operation that has a restricted input domain.
  • Overflow

  • "Real32" can give a runtime error if it is used in an operation that overflows.

Examples

Basic Examples  (4)

"Real32" can be used as an input and output from a CompiledCodeFunction:

A domain error can take place while running the function. The computation is terminated, a message is issued and the Wolfram Engine is used to compute the result:

An overflow causes an error while running the function. The computation is terminated, a message is issued and the Wolfram Engine is used to compute the result:

The "Real32" argument is automatically promoted when combined with a complex number:

The "Real32" argument is automatically promoted when combined with a "Real64":

The "Integer8" argument is automatically promoted when combined with a "Real32":