Yes, comparison with 0 is always exact; that is a consequence
of the definition of tolerance.

The right domain of 5&p: is integers.  Thus:

5&p: +/1000#0.01     
   ok because there is an integer n such that n=+/1000#0.01
5&p: 10-10          
   ok because there is an integer n such that n=10-10
5&p: -~+/1000#0.01
   ok because there is an integer n such that n=-~+/1000#0.01
5&p: 10-+/1000#0.01
   not ok because there is no integer n such that n=10-+/1000#0.01
5&p: 2^_44
   not ok because there is no integer n such that n=2^_44

= above is tolerant equality.



----- Original Message ----- 
From: "bill lam" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, April 26, 2006 9:46 PM
Subject: [Jprogramming] 5&p: 0

I remembered doc said comparison with zero is always exact.
So that is the following behavior a design feature?
    5&p: +/1000#0.01
4
    5&p: 10-10
0
    5&p: -~+/1000#0.01
0
    5&p: 10-+/1000#0.01
|domain error
|       5&p:10-+/1000#0.01
    5&p: 2^_44
|domain error
|       5&p:2^_44


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to