public class HashedDoubleRange extends Object implements LongToDoubleFunction
This simulates a uniform sample from a range of double values via long hashing. This function attempts to take a double unit interval value from a long/long division over the whole range of long values but via double value types, thus providing a very linear sample. This means that the range of double values to be accessed will not fall along all possible doubles, but will still provide suitable values for ranges close to high-precision points in the IEEE floating point number line. This suffices for most reasonable ranges in practice outside of scientific computing, where large exponents put adjacent IEEE floating point values much further apart.
This should be consider the default double range sampling function for most uses, when the exponent is not needed for readability.
| Constructor and Description |
|---|
HashedDoubleRange(double min,
double max) |
| Modifier and Type | Method and Description |
|---|---|
double |
applyAsDouble(long value) |
public double applyAsDouble(long value)
applyAsDouble in interface LongToDoubleFunctionCopyright © 2018. All rights reserved.