Java Assert assertIsProb(double x)

Here you can find the source of assertIsProb(double x)

Description

assert Is Prob

License

Apache License

Declaration

public static void assertIsProb(double x) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void assertIsProb(double x) {
        assert isProb(x) : "Not a probability [0, 1]: " + x;
    }//from  w ww.ja  va2s  . c  o m

    public static boolean isProb(double x) {
        return x >= 0 && x <= 1 && !Double.isNaN(x);
    }
}

Related

  1. assertIOThread(Thread t, boolean flag)
  2. assertIsClass(Class klazz)
  3. assertIsNotEmptyString(String string)
  4. assertIsPermutation(int[] perm)
  5. assertIsPositive(int num, String fieldName)
  6. assertIsProbability(final double probability)
  7. assertIsProperlyQuoted(String header, String tag)
  8. assertIsReady()
  9. assertLegal(Object underAssertion, String message)