public static Number abs(Number a){
  if (isFloatingPoint(a)) {
    return Math.abs(a.doubleValue());
  }
 else {
    return Math.abs(a.longValue());
  }
}

public static Number abs ( Number a ) { if ( isFloatingPoint ( a ) ) { return Math . abs ( a . doubleValue ( ) ) ; } else { return Math . abs ( a . longValue ( ) ) ; } }
returns the absolute value of the number .
