+ 2
What is the easiest way to calculate extremely precise?
I would like to compute my calculations as precise as possible, does anyone know a way to get much more preciese answers? Thank you very much.
8 Respostas
+ 6
You can use decimal module
from decimal import Decimal, getcontext
getcontext().prec = 100
print(Decimal('2') ** Decimal('.5'))
+ 3
With sympy module, you can use rational numbers, that is you can calculate with 3/7 or 31/32 etc without actually forcing the computer to round to a floating point precision.
+ 3
Can you post your code?
It returns 0.333... for both Decimal(1) / Decimal(3) and Decimal('1') / Decimal('3')
0
believe me or not,
only way to do this is only practising and more practising maths calculations as much difficult as possible
0
I mean in python...
0
Thank you so much! I haven't tested it yet becouse of an error (please check connection) but I will try when I can!
0
Thank you so much it is very precise!
0
Mert Yazici, I found that sollution online later but when I try it it says 1/3= 0.333333333333333333336135526153622836388 or something like that, and I would like something more accurate