"converting float to binary 16" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "converting float to binary 16" answered properly. Developers are finding an appropriate answer about converting float to binary 16 related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like converting float to binary 16. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on converting float to binary 16.
converting float to binary 16
import struct
#################### bin32 ################################
# import bitstring
# f1 = bitstring.BitArray(float=0.456789, length=32)
# # f1 = bitstring.BitArray(float=0.456789, length=16)
# print(f1.bin)
# print("0011011101001111")
#################### bin32 ################################
def convertFloatToBin16(x):
k = struct.pack('>e', x)
z = ''.join(format(i, '08b') for i in k)
return str(z)
print(convertFloatToBin16(0.9945678))
All those coders who are working on the Whatever based application and are stuck on converting float to binary 16 can get a collection of related answers to their query. Programmers need to enter their query on converting float to binary 16 related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about converting float to binary 16 for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of converting float to binary 16 while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "converting float to binary 16". Visit this developer's friendly online web community, CodeProZone, and get your queries like converting float to binary 16 resolved professionally and stay updated to the latest Whatever updates.