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

From: Campbell, Robert (SELEX GALILEO, UK) <"Campbell,>
Date: Thu, 7 Feb 2008 09:53:40 -0000

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

>> Chris Burrows wrote:
>> >> Additionally, how does your theory explain this one?
>> >>
>> >> OutBool ('Pi = Pi ? ', Math.Pi() = Math.Pi(); (*
FALSE *)


Robert Campbell replied:
>> With the best will in the world, this *must* be a bug, that
>> needs fixing. Urgently.


Hi

I withdraw my comment above. The compiler computes intermediate results
to 80
bits, and leaves them in 80 bit FPU (Floating Point Unit) registers when
it can.
When it can't it copies rounded intermediate results into 64 bit REAL
registers.

The first Math.Pi result is copied off the FPU stack before the second
Math.Pi is called.
Hence the comparison is between a 64 bit value and an 80 bit value.

This strategy provides the least roundoff error in a language that does
not pretend
to support an 80 bit extended precision longreal type, and I do not
consider it a bug.
Indeed I fully support it.



My comment above was partly triggered by a rather careless
misunderstanding of a test
programme I wrote. Thanks to Oms for pointing out the error in my
thinking.


Regards

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-59615763_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9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kICYgV2FsZXMuICBDb21wYW55IG5vLiAwMjQyNjEzMlxwYXINCioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXHBhcg0K
VGhpcyBlbWFpbCBhbmQgYW55IGF0dGFjaG1lbnRzIGFyZSBjb25maWRlbnRpYWwgdG8gdGhlIGlu
dGVuZGVkXHBhcg0KcmVjaXBpZW50IGFuZCBtYXkgYWxzbyBiZSBwcml2aWxlZ2VkLiBJZiB5b3Ug
YXJlIG5vdCB0aGUgaW50ZW5kZWRccGFyDQpyZWNpcGllbnQgcGxlYXNlIGRlbGV0ZSBpdCBmcm9t
IHlvdXIgc3lzdGVtIGFuZCBub3RpZnkgdGhlIHNlbmRlci5ccGFyDQpZb3Ugc2hvdWxkIG5vdCBj
b3B5IGl0IG9yIHVzZSBpdCBmb3IgYW55IHB1cnBvc2Ugbm9yIGRpc2Nsb3NlIG9yXHBhcg0KZGlz
dHJpYnV0ZSBpdHMgY29udGVudHMgdG8gYW55IG90aGVyIHBlcnNvbi5ccGFyDQoqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KlxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3Nh
Z2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04u
Q0h9fQALCPMJ
----boundary-LibPST-iamunique-59615763_-_---
Received on Thu Feb 07 2008 - 10:53:40 UTC

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