title: Gold even score
Golden Divide number 0.61803 ... is an irrational number, this constant is very important and will arise in many engineering problems. Sometimes it takes a lot of precision to figure this out.
for some precision engineering, the precision of a constant is important. Perhaps you've heard of the Hubble Space Telescope, which, after its first launch, found an artificial fabrication error,
in fact, mirror processing when there are more than the head of the hair is a lot more than a mistake, but make it a "myopia"!
So, how do we get the best possible value for the Golden segment number? There are many ways.
a relatively simple one is to use a hyphen:
1
number of gold =---------------------
1
1 +-----------------
1
1 +-------------
1
1 +---------
1 + ...
The greater the number of "layers" that the even fraction calculates, the closer the value is to the Golden segment.
take advantage of this feature to find enough accurate values for the golden segment to be rounded up to 100 decimal places.
the 3-bit value after the decimal point is: 0.618
the 4-bit value after the decimal point is: 0.6180
the 5-bit value after the decimal point is: 0.61803
the 7-bit value after the decimal point is: 0.6180340
(note the trailing 0, cannot be ignored)
your task is to write a golden segment value that is accurate to 100 digits after the decimal point.
Note: The mantissa is rounded! The mantissa is 0 also to keep!
Obviously the answer is a decimal number, which has 100 digits after the decimal point, please submit the number directly through the browser.
Note: Do not submit the content of the answer process, or other auxiliary description classes.
[Java]View Plaincopyprint?
- import java.math.bigdecimal;
-   
- public class main {
-   
- public static void main (String[] args) {
- BigDecimal bd = new BigDecimal (1);
- for (inti =0; i < +; i++) {
- BD = Bd.add (Bigdecimal.one);
- bd = bigdecimal.one.divide (Bd, 102 , bigdecimal.round_half_down );
- }
- System.out.println (Bd.tostring ());
- }
- }
last year with C Leng did not write out, now look at Java is 10 lines not to ...
The answer is
0.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911375
[JAVA] [2013 Blue Bridge Cup preliminary Java Undergraduate B group] [Gold even score]