/src/main/java/net/finmath/montecarlo/RandomVariableLazyEvaluation.java
if( cache( ) == 0) {
if ( size ( ) == 0 ) {
} @Override public double getQuantile(final double quantile) { if(isDeterministic()) { return valueIfNonStochastic; } <extra_id_0> return Double.NaN; } final double[] realizationsSorted = getRealizations().clone(); Arrays.sort(realizationsSorted); final int indexOfQuantileValue = Math.min(Math.max((int)Math.round((size()+1) * quantile - 1), 0), size()-1); return realizationsSorted[indexOfQuantileValue];