Can we have float -> binanry as fbin and binary -> float as fnum conversion in math library?
Discussions on Python.org
Can we have float -> binanry as fbin and binary -> float as fnum conversion in math library?
Can we have float → binary as fbin and binary → float as fnum conversion in math library? I am not a professional programmer, so my code is just a raw example. # float -> binary and binary -> float conversion from fractions import Fraction def fbin(x): a, b = int(x), Fraction(str(x)) - int(x) result = list() result.append(bin(a)[2:]) if not b: result.append("0") return result bits = '' for _ in range(50): b *= 2 if b >= 1: b...
Can we have float → binary as fbin and binary → float as fnum conversion in math library? I am not a professional programmer, so my code is just a raw example. # float -> binary…
0 comments
No comments yet.