[640] in java-interest

home help back first fref pref prev next nref lref last post

short circuiting is 'not'?

daemon@ATHENA.MIT.EDU (Paul Tyma)
Mon Jul 10 17:09:20 1995

Date:     Mon, 10 Jul 95 10:05:01 EDT
From: Paul Tyma <ptyma@top.cis.syr.edu>
To: java-interest@java.Eng.Sun.COM

This bit of code:

  x = ((5<6) || (8/0 <45)) ? 1 : 0 ;

and this bit of code:

  x = ((5<6) | (8/0 <45)) ? 1 : 0;

both run fine and return 1.  Changing the first conditional to
(6>5) causes and Arith exception. Seems like short circuiting
is occuring always. 

cheers


*********************************************************************
* Paul Tyma                           Email: ptyma@top.cis.syr.edu  *
* CST 2-106                           Offic: (315) 443-4122         *
* Syracuse University                 http://www.cat.syr.edu/~ptyma *
* Syracuse, New York  13244           Machine: kuzlo.cat.syr.edu    *
*********************************************************************

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post