Converts the value on top of the evaluation stack to float32.
Assembly: mscorlib (in mscorlib.dll)
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:
Convert to float32, pushing F on stack.
The stack transitional behavior, in sequential order, is:
value is pushed onto the stack.
value is popped from the stack and the conversion operation is attempted.
If the conversion is successful, the resulting value is pushed onto the stack.
The conv.r4 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also native int). Floating-point values are converted to the F type.
Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.
If overflow occurs converting a floating-point type to an integer the value returned is unspecified.
No exceptions are ever thrown when using this field.
The following Emit method overload can use the conv.r4 opcode:
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.