Calculation of PI () and 3.14159265358979 in excel

In Excel, when calculating a formula, =SIN(PI())it returns 1.22515E-16. If the value is PI() Value(3.14159265358979)directly set as = SIN (3.14159265358979), it returns 3.23114E-15.

Please, anyone can share their opinion on how excel is calculated differently when "PI" and 3.14159265358979 are passed as a parameter.

+4
source share
3 answers

The reason you see this is due to the rounding error.

Sin(PI())technically 0, as described in the Sin function documentation . However, excel returns 1.22515E-16or 0.0000000000000001225148455 (i.e. approximately 0)

3.14159265358979 PI(), , 0. 3.1415926535897, 3.141592653589 .., .

, , Excel , .

+1

:

enter image description here

A2 =PI().

A3 - 3.14159265358979.

A5 - , A2, paste-special: .

B =SIN(A2)... =SIN(A5).

, ?

Microsoft 15 IEEE 754, , IEEE 754, 15, 15,95 . , . , Excel 17 , 15 , 15 .

, =PI() 3.1415926535897931 , . 3.14159265358979. /-special: =PI(), 3.1415926535897931, 3.14159265358979.

*.xlsx ZIP , /xl/worksheets/sheet1.xml. :

<row r="2" spans="1:2" x14ac:dyDescent="0.25">
 <c r="A2" s="1">
  <f>PI()</f>
  <v>3.1415926535897931</v>
 </c>
 <c r="B2">
  <f>SIN(A2)</f>
  <v>1.22514845490862E-16</v>
 </c>
</row>
<row r="3" spans="1:2" x14ac:dyDescent="0.25">
 <c r="A3" s="1">
  <v>3.14159265358979</v>
 </c>
 <c r="B3">
  <f>SIN(A3)</f>
  <v>3.2311393144413003E-15</v>
 </c>
</row>
<row r="5" spans="1:2" x14ac:dyDescent="0.25">
 <c r="A5" s="1">
  <v>3.1415926535897931</v>
 </c>
 <c r="B5">
  <f>SIN(A5)</f>
  <v>1.22514845490862E-16</v>
 </c>
</row>

q.e.d.

+1

SIN() radians.

, PI()/180.

=SIN(PI()), PI , RADIANS(180). =SIN(PI()) =SIN(RADIANS(180)) 0.

=SIN(3.14159265358979) =SIN(PI()), PI . , , .

, .

0

Source: https://habr.com/ru/post/1683820/


All Articles