Convert a number to a big integer and try the best to preserve precision
@param number	the number
@return	the big integer, can be null if the number is null
498656
protected BigInteger toBigInteger(Number number){
		if (number == null){
			return null;
		}
		Class<?> claz = number.getClass();
		if (claz == BigInteger.class){
			return (BigInteger)number;
		}else if (claz == BigDecimal.class){
			return ((BigDecimal)number).toBigInteger();
		}else if (claz == Double.class){
			return new BigDecimal((Double)number).toBigInteger();
		}else if (claz == Float.class){
			return new BigDecimal((Float)number).toBigInteger();
		}else{
			return BigInteger.valueOf(number.longValue());
		}
	}
906197
@Pure
	@Inline(value = "$2.valueOf($1.doubleValue())", imported = BigDecimal.class)
	public static BigDecimal toBigDecimal(AtomicDouble number) {
		return BigDecimal.valueOf(number.doubleValue());
	}
784630
public double num() throws javax.xml.transform.TransformerException
  {

    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER,
          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a number");

    return 0.0;
  }
138610
static NumberMath getMath(Number number) {
        if (isLong(number)) {
            return LongMath.INSTANCE;
        }
        if (isFloatingPoint(number)) {
            return FloatingPointMath.INSTANCE;
        }
        if (isBigDecimal(number)) {
            return BigDecimalMath.INSTANCE;
        }
        if (isBigInteger(number)) {
            return BigIntegerMath.INSTANCE;
        }
        if (isInteger(number) || isShort(number) || isByte(number)) {
            return IntegerMath.INSTANCE;
        }
        // also for custom Number implementations
        return BigDecimalMath.INSTANCE;
    }
589887
public JSONWriter value(Number number) {
        return number != null ? append(number.toString()) : valueNull();
    }
1329573
public static String encodeAsIntegerNumber(Object ob) {
		BigDecimal integerBigDecimal = AmazonSimpleDBUtil.tryToStoreAsIntegerBigDecimal(ob);
		if(integerBigDecimal != null) {
			return AmazonSimpleDBUtil.encodeRealNumberRange(integerBigDecimal, AmazonSimpleDBUtil.LONG_DIGITS,
					OFFSET_VALUE);
		}

		return null;
	}
1230306
function(_number) {
    if ('undefined' == typeof _number) {
      return null;
    }
    else if ('number' != typeof(_number)) {
      throw new Error('Wrong parameter type');
    }

    var ret = '';

    for (var i = Math.floor(Math.log(parseInt(_number)) / Math.log(this.index.length)); i >= 0; i--) {
      ret = ret + this.index.substr((Math.floor(parseInt(_number) / this.bcpow(this.index.length, i)) % this.index.length), 1);
    }

    return ret.reverse();
  }
907870
public static BigDecimal toBigDecimal(String number) {
		return (null == number) ? BigDecimal.ZERO : new BigDecimal(number);
	}
345377
public static PactDslRootValue integerType(Long number) {
    PactDslRootValue value = new PactDslRootValue();
    value.setValue(number);
    value.setMatcher(new NumberTypeMatcher(NumberTypeMatcher.NumberType.INTEGER));
    return value;
  }
693170
public Integer asIntegerObj() {
		if (current == null)
			return null;
		if (current instanceof Number) {
			if (current instanceof Integer)
				return (Integer) current;
			if (current instanceof Long) {
				Long l = (Long) current;
				if (l.longValue() == l.intValue()) {
					return Integer.valueOf(l.intValue());
				}
			}
			return null;
		}
		return null;
	}
176756
public BigInteger getSerialNumber() {
        SerialNumber ser = getSerialNumberObject();

        return ser != null ? ser.getNumber() : null;
    }
1183312
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	public static int checkLong(@Nonnull final Number number) {
		Check.notNull(number, "number");
		if (!isInLongRange(number)) {
			throw new IllegalNumberRangeException(number.toString(), LONG_MIN, LONG_MAX);
		}

		return number.intValue();
	}
764340
private Double getDouble(Number number)
   {
      Double result = null;

      if (number != null)
      {
         result = Double.valueOf(number.doubleValue());
      }

      return result;
   }
1353109
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	public static boolean isInRange(@Nonnull final Number number, @Nonnull final BigInteger min, @Nonnull final BigInteger max) {
		Check.notNull(number, "number");
		Check.notNull(min, "min");
		Check.notNull(max, "max");

		BigInteger bigInteger = null;
		if (number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long) {
			bigInteger = BigInteger.valueOf(number.longValue());
		} else if (number instanceof Float || number instanceof Double) {
			bigInteger = new BigDecimal(number.doubleValue()).toBigInteger();
		} else if (number instanceof BigInteger) {
			bigInteger = (BigInteger) number;
		} else if (number instanceof BigDecimal) {
			bigInteger = ((BigDecimal) number).toBigInteger();
		} else {
			throw new IllegalNumberArgumentException("Return value is no known subclass of 'java.lang.Number': "
					+ number.getClass().getName());
		}
		return max.compareTo(bigInteger) >= 0 && min.compareTo(bigInteger) <= 0;
	}
985044
public Number getNumber(String key) throws NumberFormatException {
        String value = getString(key);
        if (value == null) {
            return null;
        }
        else {
            try {
                return Integer.valueOf(value);
            }
            catch (NumberFormatException e) {
            }
            try {
                return Long.valueOf(value);
            }
            catch (NumberFormatException e) {
            }
            return Double.valueOf(value);
        }
    }
149853
protected Number parseInteger(String string) throws ParseException {
		try {
			return Long.valueOf(string);
		} catch (NumberFormatException e) {
			fail(INTEGER);
			return null;
		}
	}
1187291
public String normalizeNumber(final String number) {
        try {
            final BigDecimal normalizedNumber = parseNumber(new NumberBuffer(
                    number));
            if (normalizedNumber == null) {
                return number;
            }
            return normalizedNumber.toBigIntegerExact().toString();

        } catch (NumberFormatException | ArithmeticException e) {
            // Return the source number in case of error, i.e. malformed input
            return number;
        }
    }