本文整理汇总了Java中org.apache.commons.math3.fraction.BigFraction.ONE属性的典型用法代码示例。如果您正苦于以下问题:Java BigFraction.ONE属性的具体用法?Java BigFraction.ONE怎么用?Java BigFraction.ONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.math3.fraction.BigFraction
的用法示例。
在下文中一共展示了BigFraction.ONE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCumulativeProbability
/**
* <p>
* Slightly more efficient than the default getCumulativeProbability
*/
@Override
public BigFraction getCumulativeProbability(int x) {
if (x >= 1 && x <= sides) {
return probability.multiply(sides - x + 1);
} else if (x > sides) {
return BigFraction.ZERO;
} else {
return BigFraction.ONE;
}
}
示例2: getCumulativeProbability
@Override
public BigFraction getCumulativeProbability(int x) {
if (x < lower) {
return BigFraction.ONE;
} else if (x >= upper) {
return BigFraction.ZERO;
} else {
return cums[x - lower];
}
}
示例3: getCumulativeProbability
@Override
public BigFraction getCumulativeProbability(int x) {
if (x < d.lowerBound()) {
return BigFraction.ONE;
} else if (x >= d.upperBound()) {
return BigFraction.ZERO;
} else {
return cums[x - d.lowerBound()];
}
}
示例4: getProbability
@Override
public BigFraction getProbability(int x) {
return x == this.x ? BigFraction.ONE : BigFraction.ZERO;
}
示例5: getCumulativeProbability
@Override
public BigFraction getCumulativeProbability(int x) {
return x > this.x ? BigFraction.ZERO : BigFraction.ONE;
}