Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Richard Lionheart
 
Posts: n/a
Default Higher precision: can one get it?

Hi All,

I demonstrating the approximation of Pi by successively computing the
perimeters of regular inscribed polygons with 2^n sides. Excel's precision
was overwhelmed at about 4000 sides.

Is there any way to get "double precision"? If worse comes to worse, I'll
use something like BigDecimal in Ruby or Perl to get greater precision.
--
Regards,
Richard


  #2   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten
 
Posts: n/a
Default Higher precision: can one get it?

Hi Richard,

Excel's precision is 15 significant digits.
If you need more, you might take a look at the XNUMBERS add-in:

http://digilander.libero.it/foxes/MultiPrecision.htm

--
Kind regards,

Niek Otten

"Richard Lionheart" wrote in message
...
Hi All,

I demonstrating the approximation of Pi by successively computing the
perimeters of regular inscribed polygons with 2^n sides. Excel's
precision was overwhelmed at about 4000 sides.

Is there any way to get "double precision"? If worse comes to worse,
I'll use something like BigDecimal in Ruby or Perl to get greater
precision.
--
Regards,
Richard




  #3   Report Post  
Posted to microsoft.public.excel.misc
Greg Lovern
 
Posts: n/a
Default Higher precision: can one get it?

XNumbers can help with demonstrating the approximation of Pi by succesively
computing the perimeters of regular inscribed polygons with 2^n sides. But
for anything requiring fractional powers or fractional roots, you'll need
something else, because XNumbers truncates fractional powers and fractional
roots to integers. Compare XNumbers to Excel:

Excel:
=1.98^1.98
(Returns 3.86720395054666)
=1.98^(1/1.98)
(Returns 1.41198766954688)

XNumbers:
=xpow(1.98,1.98)
(Returns 1.98)
=xroot(1.98,1.98)
(Returns 1.98)

My add-in xlPrecision 2.0 returns fractional powers and fractional roots
with up to 32,767 significant digits of precision:

=xlpPOWER(1.98,1.98)
(Returns
3.867203950546664475197024334694561094821782762326 45703981220472
990158197209281613382250690200215 etc., up to 32,767 digits)
=xlpROOT(1.98,1.98)
(Returns
1.411987669546878795740148157203790542076237995834 60566043557515
9344161656315787429344740444142505 etc., up to 32,767 digits)


You can download the free edition of xlPrecision 2.0 here, and use it as
long as you wish:

http://PrecisionCalc.com


Thanks,

Greg Lovern
http://PrecisionCalc.com
Get Your Numbers Right




"Niek Otten" wrote in message
...

Excel's precision is 15 significant digits.
If you need more, you might take a look at the XNUMBERS add-in:

http://digilander.libero.it/foxes/MultiPrecision.htm


"Richard Lionheart" wrote in message
...

I demonstrating the approximation of Pi by successively computing the
perimeters of regular inscribed polygons with 2^n sides. Excel's
precision was overwhelmed at about 4000 sides.

Is there any way to get "double precision"? If worse comes to worse,
I'll use something like BigDecimal in Ruby or Perl to get greater
precision.



  #4   Report Post  
Posted to microsoft.public.excel.misc
Richard Lionheart
 
Posts: n/a
Default Higher precision: can one get it?

Hi Niek and Greg ,

Thank you very much for your responses.

I downloaded the XNumbers addin and got great results. I showed my 12yo
grandson the algebra for calculating perimiters of regular inscribed
polygons using recursion and showed him the results in Excel. We compared
these with published estimates of Pi to hundreds of places. Got a
favorable comparison up to 10 places using 60 places for intermediate
results and 32 iiterations.

I'll check out xlPrecision a little later. Right now I've only got integral
exponents to deal with.

Best wishes,
Richard


  #5   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis
 
Posts: n/a
Default Higher precision: can one get it?

Hi. For the op, ... Is there any way to get "double precision"?

Not sure if you would find this interesting...
If you would like to "double" your precision, here is one method to
calculate Pi using ArcTan and just built-in functions.
This is not the fastest convergence, but it is simple. It reaches Excel's
limit in 20 loops. Maybe you can adopt it to your method.
If you would like to get real crazy, then Excel has a Fast Fourier Transform
function in the analysis toolpak that you can use to multiply large numbers
very quickly. However, Excel's built-in FFT is limited to 4096 digits.

Sub TestIt()
Debug.Print "Pi= " & Pi
End Sub

Function Pi() As Variant
'// = = = = = = = = = = = = = = = = = = = = =
'// Pi = 16*ArcTan(1/5) - 4*ArcTan(1/239)
'// By: Dana DeLouis
'// = = = = = = = = = = = = = = = = = = = = =
Dim One
Dim Two
Dim d5
Dim d239
Dim p1
Dim p2
Dim f
Dim j As Long

One = CDec(1)
Two = One + One
d5 = One / 5
d239 = One / 239
f = One

'// The first loop w/ j=0
p1 = d5
p2 = d239
Pi = Pi + (4 * f * (4 * p1 - p2)) / One
f = -f
'// Then...
For j = 1 To 19
p1 = p1 * d5 * d5
p2 = p2 * d239 * d239
Pi = Pi + (4 * f * (4 * p1 - p2)) / (One + j * Two)
f = -f
Next j
End Function

HTH. :)
--
Dana DeLouis
Win XP & Office 2003


"Richard Lionheart" wrote in message
...
Hi Niek and Greg ,

Thank you very much for your responses.

I downloaded the XNumbers addin and got great results. I showed my 12yo
grandson the algebra for calculating perimiters of regular inscribed
polygons using recursion and showed him the results in Excel. We compared
these with published estimates of Pi to hundreds of places. Got a
favorable comparison up to 10 places using 60 places for intermediate
results and 32 iiterations.

I'll check out xlPrecision a little later. Right now I've only got
integral exponents to deal with.

Best wishes,
Richard





  #6   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis
 
Posts: n/a
Default Higher precision: can one get it?

If interested, here's a newer version. I removed 5 multiplications per
loop, for a savings of about 95+ Multiplications.
Here's the output from the immediate window. The last digit will usually
be off a little.

Real Pi= 3.1415926535897932384626433832795....
My Pi= 3.1415926535897932384626433834

Again, not the fastest convergence, just one of the simplier versions for
Excel.
--
Dana DeLouis
Win XP & Office 2003

Sub TestIt()
Debug.Print "Real Pi= " & "3.1415926535897932384626433832795...."
Debug.Print " My Pi= " & Pi
End Sub

Function Pi() As Variant
'// = = = = = = = = = = = = = = = = = = = = =
'// Pi = 16*ArcTan(1/5) - 4*ArcTan(1/239)
'// By: Dana DeLouis
'// Note: Pi = 3.1415926535897932384626433832795...
'// = = = = = = = = = = = = = = = = = = = = =

Dim Two
Dim Den
Dim d5
Dim d239
Dim p1
Dim p2
Dim j As Long

Den = CDec(1)
Two = CDec(2)
d5 = Den / 5
d239 = Den / 239

'// First loop w/ j=0
p1 = d5
p2 = d239
Pi = (4 * (4 * p1 - p2)) / Den
'// Newer values...
d5 = d5 * d5
d239 = d239 * d239

'// Then...
For j = 1 To 10
p1 = p1 * d5
p2 = p2 * d239
Den = Den + Two
Pi = Pi - (4 * (4 * p1 - p2)) / Den

p1 = p1 * d5
p2 = p2 * d239
Den = Den + Two
Pi = Pi + (4 * (4 * p1 - p2)) / Den
Next j
End Function

--
Dana DeLouis
Win XP & Office 2003


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Precision as displayed problems sivatca Excel Worksheet Functions 1 December 1st 05 05:14 PM
Is there a way to count higher than 511 in binary in excel? havocdragon Excel Worksheet Functions 1 October 15th 05 05:14 AM
Precision displayed does not match precision in cell James Wilkerson Excel Discussion (Misc queries) 10 June 15th 05 02:40 PM
comparing a value in a cell to see if it is higher than a number PK Excel Worksheet Functions 9 June 2nd 05 03:35 PM
Precision as displayed Susan Lambert Setting up and Configuration of Excel 1 December 17th 04 07:36 PM


All times are GMT +1. The time now is 07:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"