Platforms to show: All Mac Windows Linux Cross-Platform

ConvertFromFloat16MBS(Number as UInt16) as Single

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method Math MBS Util Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Converts a 16bit floating point number to a 32bit floating point number.
Example
dim h1 as UInt16 = ConvertToFloat16MBS(1.0)
dim f1 as single = ConvertFromFloat16MBS(h1) // should be 1.0


dim h2 as UInt16 = ConvertToFloat16MBS(-1.0)
dim f2 as single = ConvertFromFloat16MBS(h2) // should be -1.0


dim h3 as UInt16 = ConvertToFloat16MBS(1000.0)
dim f3 as single = ConvertFromFloat16MBS(h3) // should be 1000.0


dim h4 as UInt16 = ConvertToFloat16MBS(-1000.0)
dim f4 as single = ConvertFromFloat16MBS(h4) // should be -1000.0


dim inf as single = 65504.0
dim h5 as UInt16 = ConvertToFloat16MBS(inf)
dim f5 as single = ConvertFromFloat16MBS(h5) // should be 65504


dim nan as single = sqrt(-1)
dim h6 as UInt16 = ConvertToFloat16MBS(nan)
dim f6 as single = ConvertFromFloat16MBS(h6) // should be NAN


Break // check in debugger

Blog Entries

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...