0

I combining 2 numbers together and I lest with only 3 numbers...

    s = seconds_ref[i]
    print("s: ", s)
    f = fractions_ref[i] / (2 ** 32)
    print("f: ", f)
    time = s + f
    print("time: ", time)

print:

s:  3854955049
f:  0.9089999999850988
time:  3854955049.909

How can I keep all the numbers?

thanks! :)

Abirdh
  • 11
  • 2
  • 2
    Don't add the numbers if you need to keep the precision of both numbers. See also: https://stackoverflow.com/questions/588004/is-floating-point-math-broken/588014#588014 and https://en.wikipedia.org/wiki/IEEE_754#Basic_and_interchange_formats – Jan Christoph Terasa Mar 08 '22 at 15:26
  • See also [Is floating point math broken?](https://stackoverflow.com/q/588004/3545273) – Serge Ballesta Mar 08 '22 at 15:33
  • Does this answer your question? [How to compute huge numbers with python?](https://stackoverflow.com/questions/21945923/how-to-compute-huge-numbers-with-python) – itprorh66 Mar 08 '22 at 15:52

0 Answers0