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

From: [at]} <CFB>
Date: Mon, 21 Jan 2008 10:10:50 +1030

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

>From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>Sent: Sunday, 20 January 2008 11:16 PM
>To: BLACKBOX{([at]})nowhere.xy
>Subject: Re: [BLACKBOX] CONSTant expressions
>
>> CFB Software wrote:
>> OutBool ('pi = Pi ? ', pi = Math.Pi ()); (* FALSE *)
>>
>> I would have expected the third result to be TRUE - have I
>> fallen into a carefully-laid trap?

>
> The call Math.Pi () leaves an 80-bit result in the floating point
>register, that
>is then compared with a 64-bit rounded version. Result? they
>are different!

I'm not convinced that the behaviour is intentional. Math.Pi is documented
as *returning* a REAL. i.e. 64 bits.

Additionally, how does your theory explain this one?

     OutBool ('Pi = Pi ? ', Math.Pi() = Math.Pi() ); (* FALSE *)

Regards,
Chris

Chris Burrows
CFB Software
http://www.cfbsoftware.com/cp


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-862095141_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID5Gcm9tOiBCbGFja0JveCBbbWFpbHRvOkJMQUNL
Qk9YQExJU1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gIE91dEJvb2wgKCdQaSAgICA9ICBQaSAgICAgID8gICcsIE1hdGguUGkoKSA9IE1hdGguUGko
KSApOyAgKCogRkFMU0UgKilccGFyDQpccGFyDQpSZWdhcmRzLFxwYXINCkNocmlzXHBhcg0KXHBh
cg0KQ2hyaXMgQnVycm93c1xwYXINCkNGQiBTb2Z0d2FyZVxwYXINCmh0dHA6Ly93d3cuY2Zic29m
dHdhcmUuY29tL2NwXHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vic2NyaWJlLCBz
ZW5kIGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJ
U1RTLk9CRVJPTi5DSFx9fQBIfX0=
----boundary-LibPST-iamunique-862095141_-_---
Received on Mon Jan 21 2008 - 00:40:50 UTC

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