+ 1
How to calculate decimal part of a number in python
I’m really new to python and I’m currently learning about binary system For integer numbers python can calculate the binary form really nice but when it comes to decimal part of a number python gives me an error and it’s unable to calculate Why is that ? And what is the Solution? For example : https://code.sololearn.com/cqc3ovys15L6/?ref=app i want the binary of the whole number which is 110.00001... and python seems to be unable to calculate (i calculate this on paper) i mean how to calculate binary of a number which is less than 1 (like in this case 0.0588)
3 Réponses
+ 1
Check the solution
https://code.sololearn.com/cgOVLjsECNA3/?ref=app
I hope it helps
+ 1
<Derrickee/> actually it didt cause i dont want the binary of the integer part , i want the binary of the whole number which is 110.00001... and python seems to be unable to calculate (i calculate this on paper) i mean how to calculate binary of a number which is less than 1 (like in this case 0.0588)
+ 1
Python program to convert floating to binary" https://www.tutorialspoint.com/python-program-to-convert-floating-to-binary
Read this article . I think the answer is in.Why you had that error.
Thanks 🤗