Here you can find the source of hasSignedChanged(final BigDecimal v1, final BigDecimal v2)
public static boolean hasSignedChanged(final BigDecimal v1, final BigDecimal v2)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { /**/*from w w w . j ava2 s . co m*/ * @return true if v1.signum() != v2.signum(). */ public static boolean hasSignedChanged(final BigDecimal v1, final BigDecimal v2) { return signum(v1) != signum(v2); } /** * If value is null return 0 otherwise the signum(). * * @param value * @return */ public static int signum(final BigDecimal value) { return value == null ? 0 : value.signum(); } }