UniBasic code that should work
- From: "Mike Preece" <michael@xxxxxxxxxx>
- Date: 28 Mar 2006 16:47:09 -0800
Posted on behalf of a colleague who wishes to remain nameless...
UniBasic code that should work
The results of the following code are proving to be troublesome:
A = 4.57 + (-4.58)
B = (-0.01)
PRINT 'TEST ONE: ARE ':A:' AND ':B:' THE SAME? ':
IF A = B THEN
PRINT 'YES'
END ELSE
PRINT 'NO'
END
A = OCONV(A,'MD20')
B = OCONV(B,'MD20')
PRINT 'TEST TWO: ARE ':A:' AND ':B:' THE SAME? ':
IF A = B THEN
PRINT 'YES'
END ELSE
PRINT 'NO'
END
You would expect both tests to return 'YES', but in fact, only the
second test returns 'YES'.
TEST ONE: ARE -0.01 AND -0.01 THE SAME? NO
TEST TWO: ARE -0.01 AND -0.01 THE SAME? YES
Is there something simple that I am missing?
.
- Follow-Ups:
- Re: UniBasic code that should work
- From: Cliff
- Re: UniBasic code that should work
- From: (latimerp)
- Re: UniBasic code that should work
- Prev by Date: Re: aix compressed psuedo floppies
- Next by Date: Re: UniBasic code that should work
- Previous by thread: aix compressed psuedo floppies
- Next by thread: Re: UniBasic code that should work
- Index(es):