Examples of LN


Examples of jmathexpr.arithmetic.func.Ln

            case "exp":
                stack.push(new Exp(arg));
                break;
           
            case "ln":
                stack.push(new Ln(arg));
                break;
           
            case "sqrt":
                stack.push(new Sqrt(arg));
                break;
View Full Code Here

Examples of org.apache.imperius.spl.parser.expressions.impl.Ln

        //SensorLookup lookup = new SensorLookupImpl(map);

        try {
            Vector v = new Vector();
            v.add(new ShortConstant(sn1));
            Expression e1 = new Ln(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            Expression e2 = new Ln(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            Expression e3 = new Ln(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            Expression e4 = new Ln(v,true);

            v.clear();
            v.add(new DoubleConstant(dn1));
            Expression e5 = new Ln(v,true);

      v.clear();
      v.add(propertySensor1);
      Expression eps1 = new Ln(v,true);

      v.clear();
      v.add(propertySensor2);
      Expression eps2 = new Ln(v,true);

      v.clear();
      v.add(propertySensor3);
      Expression eps3 = new Ln(v,true);

      v.clear();
      v.add(propertySensor4);
      Expression eps4 = new Ln(v,true);

      v.clear();
      v.add(propertySensor5);
      Expression eps5 = new Ln(v,true);

            assertTrue(
                (new Double(Math.log(sn1)).shortValue()
                    - ((Number) e1.evaluate()).shortValue())
                    == 0);
            assertTrue(
                (new Double(Math.log(in1)).intValue()
                    - ((Number) e2.evaluate()).intValue())
                    == 0);
            assertTrue(
                (new Double(Math.log(ln1)).longValue()
                    - ((Number) e3.evaluate()).longValue())
                    == 0);
            assertTrue(
                (new Double(Math.log(fn1)).floatValue()
                    - ((Number) e4.evaluate()).floatValue())
                    == 0);
            assertTrue(
                (new Double(Math.log(dn1)).doubleValue()
                    - ((Number) e5.evaluate()).doubleValue())
                    == 0);

      assertTrue(
        (new Double(Math.log(sn1)).shortValue()
          - ((Number) eps1.evaluate()).shortValue())
          == 0);
      assertTrue(
        (new Double(Math.log(in1)).intValue()
          - ((Number) eps2.evaluate()).intValue())
          == 0);
      assertTrue(
        (new Double(Math.log(ln1)).longValue()
          - ((Number) eps3.evaluate()).longValue())
          == 0);
      assertTrue(
        (new Double(Math.log(fn1)).floatValue()
          - ((Number) eps4.evaluate()).floatValue())
          == 0);
      assertTrue(
        (new Double(Math.log(dn1)).doubleValue()
          - ((Number) eps5.evaluate()).doubleValue())
          == 0);
       
          assertSame((new Double(dn1)).getClass(), (eps1.evaluate()).getClass());
        } catch (SPLException e) {
            fail("Received evaluation exception " + e.getMessage());
View Full Code Here

Examples of org.boris.expr.function.excel.LN

        assertEquals(eval(i, -8.9), -9);
        assertResult("19.5-int(19.5)", 0.5);
    }

    public void testLN() throws Exception {
        LN l = new LN();
        for (int i = 0; i < 100; i++) {
            double d = Math.random() * 1000;
            assertEquals("LN not working", eval(l, d), Math.log(d));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.