-2

I am writing a little python script and have run into a problem.

Comma_shift = 503559669306.1
Simpdays = (Comma_shift - math.floor(Comma_shift))*10

This should give me 1, but it gives me 0 for Simpdays. If Comma_shift is equal to 503559669306.2 I get 2, as expected. What am I doing wrong? Is there some rounding involved that I am not aware of?

Thank you!

RRR
  • 5
  • 2

1 Answers1

0

The value of Simpdays comes out to be 0.999755859375 so yes, I do think the value is being rounded.

chomprrr
  • 406
  • 4
  • 15