本文整理了Java中java.math.BigDecimal.longCompareTo()
方法的一些代码示例,展示了BigDecimal.longCompareTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BigDecimal.longCompareTo()
方法的具体详情如下:
包路径:java.math.BigDecimal
类名称:BigDecimal
方法名:longCompareTo
暂无
代码示例来源:origin: robovm/robovm
private static BigDecimal dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) {
long quotient = scaledDividend / scaledDivisor;
long remainder = scaledDividend % scaledDivisor;
int sign = Long.signum( scaledDividend ) * Long.signum( scaledDivisor );
if (remainder != 0) {
// Checking if: remainder * 2 >= scaledDivisor
int compRem; // 'compare to remainder'
compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor));
// To look if there is a carry
quotient += roundingBehavior(((int)quotient) & 1,
sign * (5 + compRem),
roundingMode);
}
// Constructing the result with the appropriate unscaled value
return valueOf(quotient, scale);
}
代码示例来源:origin: robovm/robovm
long rem = remainder.longValue();
long divisor = scaledDivisor.longValue();
compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor));
代码示例来源:origin: robovm/robovm
compRem = longCompareTo(Math.abs(fraction) * 2, sizeOfFraction);
代码示例来源:origin: com.bugvm/bugvm-rt
private static BigDecimal dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) {
long quotient = scaledDividend / scaledDivisor;
long remainder = scaledDividend % scaledDivisor;
int sign = Long.signum( scaledDividend ) * Long.signum( scaledDivisor );
if (remainder != 0) {
// Checking if: remainder * 2 >= scaledDivisor
int compRem; // 'compare to remainder'
compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor));
// To look if there is a carry
quotient += roundingBehavior(((int)quotient) & 1,
sign * (5 + compRem),
roundingMode);
}
// Constructing the result with the appropriate unscaled value
return valueOf(quotient, scale);
}
代码示例来源:origin: com.gluonhq/robovm-rt
private static BigDecimal dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) {
long quotient = scaledDividend / scaledDivisor;
long remainder = scaledDividend % scaledDivisor;
int sign = Long.signum( scaledDividend ) * Long.signum( scaledDivisor );
if (remainder != 0) {
// Checking if: remainder * 2 >= scaledDivisor
int compRem; // 'compare to remainder'
compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor));
// To look if there is a carry
quotient += roundingBehavior(((int)quotient) & 1,
sign * (5 + compRem),
roundingMode);
}
// Constructing the result with the appropriate unscaled value
return valueOf(quotient, scale);
}
代码示例来源:origin: MobiVM/robovm
private static BigDecimal dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) {
long quotient = scaledDividend / scaledDivisor;
long remainder = scaledDividend % scaledDivisor;
int sign = Long.signum( scaledDividend ) * Long.signum( scaledDivisor );
if (remainder != 0) {
// Checking if: remainder * 2 >= scaledDivisor
int compRem; // 'compare to remainder'
compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor));
// To look if there is a carry
quotient += roundingBehavior(((int)quotient) & 1,
sign * (5 + compRem),
roundingMode);
}
// Constructing the result with the appropriate unscaled value
return valueOf(quotient, scale);
}
代码示例来源:origin: ibinti/bugvm
private static BigDecimal dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) {
long quotient = scaledDividend / scaledDivisor;
long remainder = scaledDividend % scaledDivisor;
int sign = Long.signum( scaledDividend ) * Long.signum( scaledDivisor );
if (remainder != 0) {
// Checking if: remainder * 2 >= scaledDivisor
int compRem; // 'compare to remainder'
compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor));
// To look if there is a carry
quotient += roundingBehavior(((int)quotient) & 1,
sign * (5 + compRem),
roundingMode);
}
// Constructing the result with the appropriate unscaled value
return valueOf(quotient, scale);
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
private static BigDecimal dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) {
long quotient = scaledDividend / scaledDivisor;
long remainder = scaledDividend % scaledDivisor;
int sign = Long.signum( scaledDividend ) * Long.signum( scaledDivisor );
if (remainder != 0) {
// Checking if: remainder * 2 >= scaledDivisor
int compRem; // 'compare to remainder'
compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor));
// To look if there is a carry
quotient += roundingBehavior(((int)quotient) & 1,
sign * (5 + compRem),
roundingMode);
}
// Constructing the result with the appropriate unscaled value
return valueOf(quotient, scale);
}
代码示例来源:origin: FlexoVM/flexovm
private static BigDecimal dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) {
long quotient = scaledDividend / scaledDivisor;
long remainder = scaledDividend % scaledDivisor;
int sign = Long.signum( scaledDividend ) * Long.signum( scaledDivisor );
if (remainder != 0) {
// Checking if: remainder * 2 >= scaledDivisor
int compRem; // 'compare to remainder'
compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor));
// To look if there is a carry
quotient += roundingBehavior(((int)quotient) & 1,
sign * (5 + compRem),
roundingMode);
}
// Constructing the result with the appropriate unscaled value
return valueOf(quotient, scale);
}
代码示例来源:origin: MobiVM/robovm
long rem = remainder.longValue();
long divisor = scaledDivisor.longValue();
compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor));
代码示例来源:origin: com.gluonhq/robovm-rt
long rem = remainder.longValue();
long divisor = scaledDivisor.longValue();
compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor));
代码示例来源:origin: ibinti/bugvm
long rem = remainder.longValue();
long divisor = scaledDivisor.longValue();
compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor));
代码示例来源:origin: FlexoVM/flexovm
long rem = remainder.longValue();
long divisor = scaledDivisor.longValue();
compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor));
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
long rem = remainder.longValue();
long divisor = scaledDivisor.longValue();
compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor));
代码示例来源:origin: com.bugvm/bugvm-rt
long rem = remainder.longValue();
long divisor = scaledDivisor.longValue();
compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor));
代码示例来源:origin: ibinti/bugvm
compRem = longCompareTo(Math.abs(fraction) * 2, sizeOfFraction);
代码示例来源:origin: MobiVM/robovm
compRem = longCompareTo(Math.abs(fraction) * 2, sizeOfFraction);
代码示例来源:origin: com.bugvm/bugvm-rt
compRem = longCompareTo(Math.abs(fraction) * 2, sizeOfFraction);
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
compRem = longCompareTo(Math.abs(fraction) * 2, sizeOfFraction);
代码示例来源:origin: com.gluonhq/robovm-rt
compRem = longCompareTo(Math.abs(fraction) * 2, sizeOfFraction);
内容来源于网络,如有侵权,请联系作者删除!