How to express π in Euler’s computer?

Some software systems use exactly your "My theory" approach, keeping a fixed number of binary fraction bits. That's called "fixed point binary" representation, and it used to be used a lot when floating point hardware was an exception rather than the rule. The "double" type in C, C++, Java, etc. is a floating point type, that takes your idea one step further.

It's the binary equivalent of scientific notation, if you remember that from middle/high school. Every nonzero number is a binary fraction in form 1.xxxxx... along with an integer exponent that says what power of two to multiply that fraction by to get the true number. Variations on that general idea have been used, but almost every CPU now supports a specific standard authored by the IEEE.

The leading 1. In the fraction is not stored (there's a special representation for 0), just "x" bits following the "binary point". The "double" type uses the 64-bit format, with a sign bit (0=positive, 1=negative), 52 fraction bits (the "x" bits) and 11 bits to represent exponents in the range -1022 to +1023.

Technically, a bias of 1023 is added to the true exponent to get a 11-bit unsigned integer in the range 1..2046. Exponent values of 0 and 2047 (all 0 bits or all 1 bits in the 11 bit field) are used to represent 0, infinity, different kinds of NaN ("not a number") values, and some "denormalized" values for graceful loss of precision on numbers very close to zero. That's it in a nutshell, probably more than you wanted.

Wikipedia and other sites have good descriptions. This format is the explicit standard for Java and C# doubles, and has become de facto standard these days for C, C++ and Objective C languages directly based on C. Python typically follows the C standard for the platform, and only uses the double format for floating point.

JavaScript and several other languages take an even more direct approach in that double is the *only* number format supported...and it's probably IEEE 64-bit format. In most of the C-inspired languages (including Java), there is also a float type that uses only 32 bits to save space. Avoid it unless you have a serious need to save that space.

The loss of precision usually isn't worth it. Https://en.wikipedia.org/wiki/Double-pre...

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions