Re: Numeric problem in BlackBox 1.4
----boundary-LibPST-iamunique-1179941811_-_-
Content-type: text/plain
> Robert and Dominik:
>
> testing REALs for equality is in fact advised against
> in every programming textbook, precisely because of the
> small differences that can get lost along the way.
> The textbooks would rather suggest the test of the form
> IF (ABS (real1 - real2) < epsilon) THEN
> where the epsilon is a constant considered insignificant
> in a given application.
The 'rule' above, like all programming rules (except this one),
should be regarded as a guideline. Testing REALs for equality
should only be done when you have deliberately controlled the
state of the LSBit of the binary in your application.
The problem above is what value of epsilon should I use.
A good solution (in its appropriate context) is the following
line of code
"if (abs(e(m))+dd.eq.dd) goto 2"
taken from Numerical Recipes in FORTRAN 77 2'nd edition
page 474 line 9.
If fact this is the exception that 'proves' several rules!
Cheers
Robert
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-1179941811_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI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RccGFyDQogICBvd25lci1ibGFja2JveEBvYmVyb24uY2hccGFyDQpc
cGFyDQpDdXJyZW50IHBvc3RpbmcgcG9saWN5OlxwYXINClxwYXINCmEpIFRvIHBvc3QgeW91IHNo
b3VsZCB1c2UgdGhlIHNhbWUgYWRkcmVzcyBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmliZWQgdG8g
dGhlIG1haWxpbmcgbGlzdC4gVGhhdCB3YXksIHRoZSBsaXN0IHNlcnZlciB3aWxsIHJlY29nbml6
ZSB5b3UgYXMgc3Vic2NyaWJlciBhbmQgZm9yd2FyZCB5b3VyIHBvc3RpbmcgaW1tZWRpYXRlbHks
IHdpdGhvdXQgY3JlYXRpbmcgYW55IG92ZXJoZWFkLlxwYXINClxwYXINCmIpIElmLCBmb3Igc29t
ZSByZWFzb24sIHlvdSBjYW5ub3QgcG9zdCBmcm9tIHRoZSBhZGRyZXNzLCBieSB3aGljaCB5b3Ug
YXJlIHN1YnNjcmliZWQsIHlvdXIgbWVzc2FnZSB3aWxsIGJlIG1vZGVyYXRlZCB0byBhdm9pZCBz
cGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRlbiBjYXVzZSBz
b21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFyIG92ZXIgd2Vla2VuZHMgb3IgaG9seWRheXMuXHBhcg0K
fQ==
----boundary-LibPST-iamunique-1179941811_-_---
Received on Tue Feb 18 2003 - 12:35:00 UTC
This archive was generated by hypermail 2.3.0
: Thu Sep 26 2013 - 06:29:26 UTC