- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can one assign NaN or some non-number.
var=NULL() does not seem to work.
The idea is to signal the caller that of a function that an invalid call was made and to recover gracefully.
Yes , I have not yet studied cvf's ability to throw proper exceptions.
tnx in adv.
Tim
var=NULL() does not seem to work.
The idea is to signal the caller that of a function that an invalid call was made and to recover gracefully.
Yes , I have not yet studied cvf's ability to throw proper exceptions.
tnx in adv.
Tim
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One method I have used successfully in the past is to write the NAN bit pattern
into an integer variable and then use TRANSFER() to move this pattern into a
floating-point variable. E.g.
INTEGER*4 I
INTEGER*8 J
REAL*4 X
REAL*8 Y
I = Z'FFFFFFFF'
J = Z'FFFFFFFFFFFFFFFF'
X = TRANSFER(I)
Y = TRANSFER(J)
The bit pattern with all 1s is just one of the many available NaN bit patterns. By
using different NaNs, you could track where in a computation the uninitialized
data occured.
-- Norbert
into an integer variable and then use TRANSFER() to move this pattern into a
floating-point variable. E.g.
INTEGER*4 I
INTEGER*8 J
REAL*4 X
REAL*8 Y
I = Z'FFFFFFFF'
J = Z'FFFFFFFFFFFFFFFF'
X = TRANSFER(I)
Y = TRANSFER(J)
The bit pattern with all 1s is just one of the many available NaN bit patterns. By
using different NaNs, you could track where in a computation the uninitialized
data occured.
-- Norbert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Norb,
Thank much,
I also tot of dis:
negOne=-1.
x=sqrt(negOne)
Tim
Thank much,
I also tot of dis:
negOne=-1.
x=sqrt(negOne)
Tim

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page