Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3934 Представления

Hello, 


I must handle numbers with high decimal precision due to the type of data I am measuring.


When doing the exercise of saving the number 744123812.85936641353 it shows me 744,123,812.85936677456 and 744123812.85936653614 is stored in the data bd. I don't understand what I'm doing wrong.


Could you give me a hand?

num= fields.Float('Number', digits=(21,11))
Аватар
Отменить
Лучший ответ

Hi Gustavo:

This is a standard issue with floating point arithmetic in python. Here's a link to a description of the issue and how to code to handle it.

https://docs.python.org/3/tutorial/floatingpoint.html?highlight=float precision

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
нояб. 23
1144
0
июн. 23
2320
0
окт. 22
2198
0
окт. 22
2308
2
окт. 21
4616