Re: [BLACKBOX] Math.Pi (was: CONSTant expressions)

From: Campbell, Robert D (SELEX) (UK Edinburgh) <"Campbell,>
Date: Mon, 21 Jan 2008 10:35:45 -0000

----boundary-LibPST-iamunique-1237806408_-_-
Content-type: text/plain

Chris

>> I first noticed pi # Pi about 10 years ago!
>> I vaguely remember investigating this at the time and discovering
that Pi was more
>> accurate than pi. But my memory could be playing me tricks.


In the code below a and b are approximations to
0.00000890891020676153735661672049711580283060062489... .

The error in a is about 1.22464023514E-016,
which is consistent with pi being correct to about 64 bits.

The error in b is about -5.08219768353E-020,
which is consistent with Math.Pi being correct to about 80 bits,
and the subtraction being done to 80 bits.


  CONST
    ratPi = 3.1416015625; (* 3217 / 1024, Exactly *)
  VAR
    a, b, pi : REAL;
  BEGIN
    pi := Math.Pi ();
    a := ratPi - pi;
    b := ratPi - Math.Pi ();


Cheers

Robert

SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1237806408_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxnc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zb24uXHBhcg0KKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipccGFyDQpc
cGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdpdGgg
Ym9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT0JFUk9OLkNIXHBhcg0K
fQ=
----boundary-LibPST-iamunique-1237806408_-_---
Received on Mon Jan 21 2008 - 11:35:45 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:31:09 UTC