----boundary-LibPST-iamunique-1220792419_-_-
Content-type: text/plain
Andrew
My platform independent code ...
CONST
nanS = {19 .. 30};
PROCEDURE IsNan (x : REAL) : BOOLEAN;
VAR
xSet : SET;
BEGIN
xSet := SYSTEM.VAL (SET, SHORT (ASH (SYSTEM.VAL (LONGINT, x),
-32)));
RETURN nanS - xSet = {}
END IsNan;
I neither guarantee it is BEST, or even correct. I haven't used it for
years.
Cheers
Robert
>> -----Original Message-----
>> From: blackbox{([at]})nowhere.xy>> Behalf Of A Thomas
>> Sent: 13 August 2007 09:04
>> To: BlackBox Mailing List
>> Subject: [BlackBox] - testing for NaNs
>>
>> *** WARNING ***
>>
>> This mail has originated outside your organization, either
>> from an external partner or the Global Internet.
>> Keep this in mind if you answer this message.
>>
>> Hei,
>>
>> I would like to test a REAL to see if it is a NaN. What
>> is the best way of doing this? If I use a variant record I
>> can regard the 8 byte real as two 4 byte integers (or maybe
>> better two variables of type SET)But what bit pattern will
>> indicate a NaN?
>>
>> Thanks
>>
>> Andrew
>>
>> --- BlackBox
>> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy>>
>>
>>
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.
********************************************************************
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1220792419_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmls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Ab2J9fQAg
ezE5IC4uIDMwfQ=
----boundary-LibPST-iamunique-1220792419_-_---
Received on Mon Aug 13 2007 - 11:43:51 UTC