Package jmathexpr.number.set

Examples of jmathexpr.number.set.Interval


    }
   
    @Test(dependsOnMethods = { "testFunctions" })
    public void testIntervals() {
        Expression contains, evaluated;
        Interval interval = new Interval(true, N.create(0), N.create(1), true); // [0, 1]
        System.out.printf("%s%n", interval);

        contains = new ElementOf(R.create(-1), interval);
        evaluated = contains.evaluate();
        System.out.printf("  %s : %s%n", contains, evaluated);
        assertEquals(evaluated, TruthValue.False);
       
        contains = new ElementOf(R.create(0), interval);
        evaluated = contains.evaluate();       
        System.out.printf("  %s : %s%n", contains, evaluated);
        assertEquals(evaluated, TruthValue.True);
       
        interval = new Interval(false, N.create(0), N.create(1), true); // (0, 1]
        System.out.printf("%s%n", interval);
       
        contains = new ElementOf(R.create(0), interval);
        evaluated = contains.evaluate();
        System.out.printf("  %s : %s%n", contains, evaluated);
        assertEquals(evaluated, TruthValue.False);
       
        contains = new ElementOf(Z.create(13), interval);
        evaluated = contains.evaluate();
        System.out.printf("  %s : %s%n", contains, evaluated);
        assertEquals(evaluated, TruthValue.False);
       
        interval = new Interval(false, N.create(0), Infinity.PLUS_INFINITY, false); // (0, inf)
        System.out.printf("%s%n", interval);

        contains = new ElementOf(R.create(3.14), interval);
        evaluated = contains.evaluate();
        System.out.printf("  %s : %s%n", contains, evaluated);
View Full Code Here

TOP

Related Classes of jmathexpr.number.set.Interval

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.