1
0
mirror of https://github.com/danog/math.git synced 2025-01-22 21:51:22 +01:00

Simplify BigDecimal::ofUnscaledValue()

This commit is contained in:
Benjamin Morel 2015-07-04 01:53:16 +02:00
parent 9017519b5d
commit 147df4b73c

View File

@ -78,15 +78,7 @@ final class BigDecimal extends BigNumber implements \Serializable
throw new \InvalidArgumentException('The scale cannot be negative.');
}
if (is_int($value)) {
return new BigDecimal((string) $value, $scale);
}
if (! $value instanceof BigInteger) {
$value = BigInteger::of($value);
}
return new BigDecimal((string) $value, $scale);
return new BigDecimal((string) BigInteger::of($value), $scale);
}
/**