update on various python tools
This commit is contained in:
13
python/floatingpoint/main.py
Normal file
13
python/floatingpoint/main.py
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import struct
|
||||
|
||||
def float_bin(number):
|
||||
return bin(struct.unpack('<I', struct.pack('<f', number))[0])
|
||||
|
||||
def main():
|
||||
|
||||
print(float_bin(5.75))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user