Browse Source

imported patch sample-PrismUtils-bitsForEncoding.patch

tud-infrastructure-2018-10-12
Joachim Klein 7 years ago
parent
commit
2edbe1cf4c
  1. 8
      prism/src/prism/PrismUtils.java

8
prism/src/prism/PrismUtils.java

@ -67,6 +67,14 @@ public class PrismUtils
return Math.log(x) / Math.log(2);
}
/**
* Compute the number of bits needed to encode n different values.
*/
public static int bitsForEncoding(int n)
{
return (int) Math.ceil(PrismUtils.log2(n));
}
/**
* See if two doubles are within epsilon of each other (absolute error).
*/

Loading…
Cancel
Save