commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kelly Chen" <>
Subject JEXL divide by zero
Date Tue, 16 Jun 2009 18:17:40 GMT
Currently in and, we explicitly catch
div/0 and return 0. The code snippet looks like the following:



         * catch div/0


        if (r.doubleValue() == 0.0) {

            return new Double(0.0);



I just wonder what is the consideration for handling this way instead of
throwing an ArithemticException.  Right now this behavior hides the
divided by zero issue and generates some result that is not necessary
correct depends on the usage.



The information contained in this message may be legally privileged and confidential.  It
is intended to be read only by the individual or entity to whom it is addressed or by their
designee. If the reader of this message is not the intended recipient, you are on notice that
any distribution of this message, in any form, is strictly prohibited.  If you have received
this message in error, please immediately notify the sender and/or SuccessFactors, Inc. by
telephone at (650) 645-2000 and delete or destroy any copy of this message.

  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message