upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

mpmath fac is incorrect for large decimal places #221

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
steps to take:

1. mp.dps = 50 
2. mp.fac(0.8)

What is the expected output? What do you see instead?
Expected output:
0.93138377098024269890905675061476695451356941511295

Instead I see:
0.931383770980242710696800679942723990284391791197494

What version of the product are you using? On what operating system?
Python 2.6.6 on Windows XP and Windows 7 and mpmath 0.17 win32

Please provide any additional information below.
After 15 decimal places the result becomes incorrect!

Original issue reported on code.google.com by vick1...@orange.mu on 19 Mar 2012 at 11:21

GoogleCodeExporter commented 9 years ago
This is because the input is only accurate to 15 decimal places. Use 
mp.fac("0.8").

Original comment by fredrik....@gmail.com on 19 Mar 2012 at 11:25

GoogleCodeExporter commented 9 years ago
yeah you're right!

It worked!

Thanks

Original comment by vick1...@orange.mu on 19 Mar 2012 at 1:11