Exact { @UserFunction @Description("apoc.number.exact.toExact(number) - return the exact value") public Long toExact(@Name("number")Long number){ if(number == null) return null; return new BigDecimal(number).longValueExact(); }  @UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") String add(@Name("stringA")String stringA, @Name("stringB")String stringB); @UserFunction @Description("apoc.number.exact.sub(stringA,stringB) - return the substraction's of two large numbers") String sub(@Name("stringA")String stringA, @Name("stringB")String stringB); @UserFunction @Description("apoc.number.exact.mul(stringA,stringB,[prec],[roundingModel]) - return the multiplication's result of two large numbers ") String mul(@Name("stringA")String stringA, @Name("stringB")String stringB, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.div(stringA,stringB,[prec],[roundingModel]) - return the division's result of two large numbers") String div(@Name("stringA")String stringA, @Name("stringB")String stringB, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toInteger(string,[prec],[roundingMode]) - return the Integer value of a large number") Long toInteger(@Name("stringA")String string, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toFloat(string,[prec],[roundingMode]) - return the Float value of a large number") Double toFloat(@Name("stringA")String string, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toExact(number) - return the exact value") Long toExact(@Name("number")Long number);  }
@Test public void testToExact(){ testCall(db,"return apoc.number.exact.toExact(521468545698447) as value", row -> assertEquals(new Long("521468545698447"), row.get("value"))); }