@Test public void testDoubleToLongWithNegativeValidArgument() { assertEquals("doubleToLong() failed!", -13L, EquationUtil.doubleToLong(-12.3)); }
public static long doubleToLong(final double d) { if (d > Long.MAX_VALUE || d < Long.MIN_VALUE) throw new IllegalArgumentException("floating point value is too large to be converted to a Long."); double x = ((Double)d).longValue(); if (x != d && d < 0.0) --x; return (long)x; }
EquationUtil { public static long doubleToLong(final double d) { if (d > Long.MAX_VALUE || d < Long.MIN_VALUE) throw new IllegalArgumentException("floating point value is too large to be converted to a Long."); double x = ((Double)d).longValue(); if (x != d && d < 0.0) --x; return (long)x; } }
EquationUtil { public static long doubleToLong(final double d) { if (d > Long.MAX_VALUE || d < Long.MIN_VALUE) throw new IllegalArgumentException("floating point value is too large to be converted to a Long."); double x = ((Double)d).longValue(); if (x != d && d < 0.0) --x; return (long)x; } private  EquationUtil(); }
EquationUtil { public static long doubleToLong(final double d) { if (d > Long.MAX_VALUE || d < Long.MIN_VALUE) throw new IllegalArgumentException("floating point value is too large to be converted to a Long."); double x = ((Double)d).longValue(); if (x != d && d < 0.0) --x; return (long)x; } private  EquationUtil(); static String attribNameAsReference(final String attribName); static long doubleToLong(final double d); static void refreshEquations(CyTable table, EquationCompiler compiler); static boolean eqnTypeIsCompatible(final Class<?> columnType, final Class<?> listElementType, final Class<?> eqnType); static String getUnqualifiedName(final Class<?> type); }
EquationUtil { public static long doubleToLong(final double d) { if (d > Long.MAX_VALUE || d < Long.MIN_VALUE) throw new IllegalArgumentException("floating point value is too large to be converted to a Long."); double x = ((Double)d).longValue(); if (x != d && d < 0.0) --x; return (long)x; } private  EquationUtil(); static String attribNameAsReference(final String attribName); static long doubleToLong(final double d); static void refreshEquations(CyTable table, EquationCompiler compiler); static boolean eqnTypeIsCompatible(final Class<?> columnType, final Class<?> listElementType, final Class<?> eqnType); static String getUnqualifiedName(final Class<?> type);  }