# Class Probabilities

java.lang.Object
io.jenetics.internal.math.Probabilities

public final class Probabilities extends Object
Mathematical functions regarding probabilities.
Since:
1.4
Version:
7.2
• ## Field Summary

Fields
Modifier and Type
Field
Description
`static final double`
`EPSILON`
Values smaller than this value are treated as zero.
• ## Method Summary

Modifier and Type
Method
Description
`static boolean`
`isOne(double value)`
Return `true` if the given value can be treated as probability one.
`static boolean`
`isZero(double value)`
Return `true` if the given value can be treated as probability zero.
`static float`
`toFloat(int probability)`
Maps the integer probability, within the range `[Integer.MIN_VALUE, Integer.MAX_VALUE]` back to a float probability within the range `[0, 1]`.
`static int`
`toInt(double probability)`
Maps the probability, given in the range `[0, 1]`, to an integer in the range `[Integer.MIN_VALUE, Integer.MAX_VALUE]`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ## Field Details

• ### EPSILON

public static final double EPSILON
Values smaller than this value are treated as zero.
Since:
7.2
• ## Method Details

• ### isZero

public static boolean isZero(double value)
Return `true` if the given value can be treated as probability zero.
Parameters:
`value` - the probability value to test
Returns:
`true` if the given value can be treated as probability 0
Since:
7.2
• ### isOne

public static boolean isOne(double value)
Return `true` if the given value can be treated as probability one.
Parameters:
`value` - the probability value to test
Returns:
`true` if the given value can be treated as probability 1
Since:
7.2
• ### toInt

public static int toInt(double probability)
Maps the probability, given in the range `[0, 1]`, to an integer in the range `[Integer.MIN_VALUE, Integer.MAX_VALUE]`.
Parameters:
`probability` - the probability to widen.
Returns:
the widened probability.
Maps the integer probability, within the range `[Integer.MIN_VALUE, Integer.MAX_VALUE]` back to a float probability within the range `[0, 1]`.
`probability` - the integer probability to map.
the mapped probability within the range `[0, 1]`.