Brian Dunning's FileMaker Custom Functions

Float32toBinary ( float )

Convert a decimal number to float32 (IEEE-754) binary format.

  Average rating: 4.6 (14 votes) Log in to vote

Jake DeGroot   Jake DeGroot

Share on Facebook Share on Twitter

  Sample input:
Float32toBinary ( 25 )
Float32toBinary ( 1 )
Float32toBinary ( -.25 )
Float32toBinary ( 4.765 )
Float32toBinary ( -153.22586 )
  Sample output:
01000001110010000000000000000000
00111111100000000000000000000000
10111110100000000000000000000000
01000000100110000111101011100001
11000011000110010011100111010010

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Requires BaseConvert (http://www.briandunning.com/cf/901) and FracDecToBin (http://www.briandunning.com/cf/1877)

 

Comments

Arjen van Dijk   Arjen van Dijk, The Netherlands
Jun 26, 2018
I found something strange two different inputs have the same result, where i think the second one is wrong :
1) Hex C2B60000 > Bin 11000010101101100000000000000000 > Dec -91
2) Hex C11FFFFC > Bin 11000001000111111111111111111100 > Dec -91 But must be -10 !!
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.