Trying to perform that calculation but it fails. Is that a bug? Python 3.10.5
Asked
Active
Viewed 89 times
-6

ghostcasper
- 99
- 2
- 7
-
What do you mean "fails"? Is it the engineering notation you're unfamiliar with? What were you _expecting_? – jonrsharpe Jul 31 '22 at 07:49
-
https://idownvotedbecau.se/imageofcode – Sören Jul 31 '22 at 07:50
-
@jonrsharpe I wasn't expecting the 1 at the end as everyone would not expect? – ghostcasper Jul 31 '22 at 07:53
-
There is a module (decimal) which provides for floating-point arithmetic to arbitrary precision. – user19077881 Jul 31 '22 at 08:02
1 Answers
-2
It is not a bug! Your code works perfectly fine.
... switches to scientific notation when the values are very large or very small. For example:
- 2.3e^-5, means 2.3 times ten to the minus five power, or 0.000023
- 4.5e^6 means 4.5 times ten to the sixth power, or 4500000 which is the same as 4,500,000

DialFrost
- 1,610
- 1
- 8
- 28