Skip to content

Instantly share code, notes, and snippets.

@thata

thata/bin2float.rb

Created May 26, 2021
Embed
What would you like to do?
# bin2float.rb
# usage:
# ruby bin2float.rb 11000010111011010100000000000000 #=> -118.625
puts [ARGV[0]].pack('B*').unpack('g')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment