Pi approximation games

formatting link

Octave is...

-- Les Cragill

Reply to
Les Cargill
Loading thread data ...

formatting link

Yup, Octave and Scilab. But not Mathematica, MathCAD, MATLAB etc.

Reply to
Spehro Pefhany

Alll valid points.

But, in the interest of furthering my own point of view, I will ignore all facts that don't support it.

Also, in the tradition set by the church, I'm introducing an "Index of Prohibited Books" (I'll e-mail you the first revision). From this point forward, all books that mention floating point are prohibited.

Also, any books that conjecture that the Earth revolves around the Sun are prohibited.

Books that conjecture that the Earth revolves around the Sun and where floating-point arithmetic was used to arrive at that conclusion are doubly prohibited.

DTA

Reply to
David T. Ashley

Thanks for the literary link. Yet more books that I will never have time to read. As Carl Sagan said, there is only time to read a few thousand good books in a human lifetime. I'm not a spring chicken, and at this point I have to choose carefully.

DTA

Reply to
David T. Ashley

Hmm.. true, but I think I ned pi more often than the number of my fingers, so I think it would be a win.

-jm

Reply to
Jukka Marin

I thought that the PC term for "Murricans" is "USAnians".

Stephen

--
Stephen Pelc, stephenXXX@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
Reply to
Stephen Pelc

Yes, it is pretty easy to write a program to calculate e. e has the value 2.11111111... in factorial radix. The first digit after the radix point is in the 1/2 place, the next is in the 1/6 place, and so on. All you have to do to print out the value of e is convert to base 10.

Scott

--
Scott Hemphill	hemphill@alumni.caltech.edu
"This isn't flying.  This is falling, with style."  -- Buzz Lightyear
Reply to
Scott Hemphill

That's actually pretty much the only definite advantage of floats. You can express everything in actual SI units, and the FP engine will take care of all the large and small powers-of-ten for you.

Same with floats, except that people so get used to being able to ignore these most of the time that when they _do_ come back to bite, the results will be even more hilarious/disastrous.

To paraphrase another old adage: An integer can become huge; but for your result to become totally _infinite_, you need floats.

Same with floats unless you go "ach, to hell with excess memory consumption" and do everything, including result storage, in maximum available precision (double precision or more).

And then of course, there's the big catch: the actual resolution of a single-precision float is not really all that great. The C programming language only guarantees a resolution of 1.0e-5 --- that is less than 2 bits better than a signed fixed point number which would fit in an int16_t!

Granted, these days you're pretty much certain the FP format will be better than the minimum required --- but I will _not_ be the one to let reality intrude on this nice little hair-splitting session ;-P

Reply to
Hans-Bernhard Bröker

(snip)

Not necessarily more efficient, but you can compute the Nth hexadecimal digit of pi without computing the N-1 digits in between.

One use is for testing a computation using a different algorithm.

There is a web page by someone who has computed trillions of decimal digits, doing the computation in binary and then converting to decimal. At various points, the result is compared against hex digits computed using the other algorithm.

-- glen

Reply to
glen herrmannsfeldt

As far as I know, it is that no-one has yet found the algorithm that expands to decimal digits. It is convenient for users of binary computers that there is one for base 16. (One could have been less lucky, and had it come out in base 13.)

Pi is a little unusual, in that there are many different ways to compute it. It might be that square roots could have a similar algorithm, but then, as I remember it, they are just irrational but not transcendental.

There are some irrational numbers that have nice simple definitions, such as ln(2). Roots of Bessel functions might be another interesting case to look at.

-- glen

Reply to
glen herrmannsfeldt

Actually, the US has been officially metric since 1866. At that time, the inch was defined as 1/39.37 meters. (The standard meter was then the distance between two marks on an iron -- later platinum-iridium -- bar in Paris.) That made the inch 25.40000508001 millimeters long.

In 1960 the meter was defined as 1,650,763.73 wavelengths of the orange-red line of krypton 86, and the inch was redefined to be 25.4 mm exactly about a year earlier. (I saw no need to replace my micrometer.) In order to maintain the integrity of old geodetic records, The old foot is now named a survey foot. A survey foot is 1.000002 modern foot. Life is messy.

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

Eh? Suppose a bag of shot with each piece weighing an ounce. An integer number of pieces will surely not fill any arbitrary volume.

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

We're not so far apart. I often use 25 (~ circumference of earth in kilomiles) / 8 (~ approximate diameter).

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

A lump of pure silicon must, by definition, contain an integral number of silicon atoms.

Reply to
Robert Wessel

I have a 30's-era CRC handbook which confirms that the Amer-inch and Brit-inch were then different, and bracketed the value of the Modern Inch.

Steve

Reply to
Steve Pope

formatting link

I haven't hit a case with Octave where it left me needing MATLAB... but I don't use it very heavily.

-- Les Cargill

Reply to
Les Cargill

No. It stands to reason that Avogadro's number is not only not integral but irrational at truly arbitrary levels of precision. To make the arithmetic slightly easier to grasp consider for a moment an alternative reality where atoms are rather more massive and a C-12 atom has a mass of exactly 5g. A mole of C-12 MUST have a mass of 12g and so a mole works out at 2.4 atoms.

In reality the mass of an atom is almost infinitely less, but there is still the problem that n C-12 atoms have a mass of 11.9999...9998712g but n+1 atoms have a mass of 12.0000...0003425g. There's no reason at all to suppose that an exact integral relationship must exist. In practice of course you could round off to the nearest atom or even tens of billions of atoms with no real-world impact at all, but that is not how Avogadro's number is _currently_ defined.

--
Andrew Smallshaw
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

Too bad the binding energy amounts to more than several atoms' mass, and likely isn't an integral number.

The mass of a silicon atom is around 27GeV/c^2, so at an average binding energy of 2eV or so, it only takes 1.3e9 atoms in a pile (a grain of about fractional um size) to accrue an extra atom's worth of mass-energy.

They could define it in terms of mass at infinity (unbound) per atom, but that doesn't make much sense when you have a polished sphere or whatever containing a few faraday volts of 'excess' binding energy.

Tim

-- Deep Friar: a very philos>>

Reply to
Tim Williams

I assume they include the mass associated with binding energy when they do the calculation.

Steve

Reply to
Steve Pope

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.