Method SingleToByte
SingleToByte(Single, Int32, Int32)
Converts a 32 bit
Values less than zero are all mapped to zero.
Values are truncated (rounded down) to the nearest 8 bit value.
Values between zero and the smallest representable value are rounded up.
Declaration
public static byte SingleToByte(float f, int numMantissaBits, int zeroExp)
Parameters
Type | Name | Description |
---|---|---|
System.Single | f | The 32 bit |
System.Int32 | numMantissaBits | The number of mantissa bits to use in the byte, with the remainder to be used in the exponent. |
System.Int32 | zeroExp | The zero-point in the range of exponent values. |
Returns
Type | Description |
---|---|
System.Byte | The 8 bit float representation. |