From: Michael G. <gof...@us...> - 2007-09-03 14:56:50
|
Update of /cvsroot/octave/octave-forge/extra/jhandles/src/org/octave/graphics In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2798/src/org/octave/graphics Modified Files: Utils.java Log Message: add NaN/Inf test function Index: Utils.java =================================================================== RCS file: /cvsroot/octave/octave-forge/extra/jhandles/src/org/octave/graphics/Utils.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Utils.java 31 Aug 2007 15:04:00 -0000 1.14 +++ Utils.java 3 Sep 2007 12:21:04 -0000 1.15 @@ -288,4 +288,16 @@ { return new ImageIcon(Utils.class.getResource("/org/octave/graphics/images/" + name + ".png")); } + + public static boolean isNaNorInf(double x) + { + return (Double.isInfinite(x) || Double.isNaN(x)); + } + + public static boolean isNaNorInf(double x, double y, double z) + { + return (Double.isInfinite(x) || Double.isNaN(x) || + Double.isInfinite(y) || Double.isNaN(y) || + Double.isInfinite(z) || Double.isNaN(z)); + } } |