There is a task of transforming float in the values of the type int (one float value in one int value) without loss of information, i.e., then the reverse transformation can be performed later. How can this be implemented?
Important h2>
it is necessary that the order and sum,
i.e. For any a, b: float should be performed:
to_float (to_int (a) + to_int (b)) == a + bto_int (a) & lt; to_int (b) at a & lt; b, etc. found on the English -speaking SO, where the structure of the float values is represented, but I can’t imagine how it can be applied to its task.
Note: nan and Inf You do not need to transform into my task.
attempts to solve
The production of serialization using pickle.dumps , and then getting into from these baites, from these baites. But this is not at all a rational decision and it does not satisfy the requirements at all.
there were attempts to realize this through byte representations of numbers (), the amount is not preserved in this option.
question@mail.ru
·