Examples of exec()


Examples of org.apache.pig.piggybank.evaluation.math.ROUND.exec()

   public void testROUND() throws Exception{
       EvalFunc<DataAtom> ROUND = new ROUND();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          ROUND.exec(tup, output);
          double expected = Math.round(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.SCALB.exec()

          EvalFunc<DataAtom> SCALB = new SCALB();
          Tuple tup = new Tuple(2);
          tup.setField(0, 1);
          tup.setField(1,2);
          DataAtom output = new DataAtom();
          SCALB.exec(tup, output);
          double expected = Math.scalb(1,2);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.SIGNUM.exec()

   public void testSIGNUM() throws Exception{
       EvalFunc<DataAtom> SIGNUM = new SIGNUM();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          SIGNUM.exec(tup, output);
          double expected = Math.signum(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.SIN.exec()

   public void testSIN() throws Exception{
       EvalFunc<DataAtom> SIN = new SIN();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          SIN.exec(tup, output);
          double expected = Math.sin(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.SINH.exec()

   public void testSINH() throws Exception{
       EvalFunc<DataAtom> SINH = new SINH();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          SINH.exec(tup, output);
          double expected = Math.sinh(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.SQRT.exec()

   public void testSQRT() throws Exception{
       EvalFunc<DataAtom> SQRT = new SQRT();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          SQRT.exec(tup, output);
          double expected = Math.sqrt(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.TAN.exec()

   public void testTAN() throws Exception{
       EvalFunc<DataAtom> TAN = new TAN();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          TAN.exec(tup, output);
          double expected = Math.tan(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.TANH.exec()

   public void testTANH() throws Exception{
       EvalFunc<DataAtom> TANH = new TANH();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          TANH.exec(tup, output);
          double expected = Math.tanh(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.ULP.exec()

   public void testULP() throws Exception{
       EvalFunc<DataAtom> ULP = new ULP();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          ULP.exec(tup, output);
          double expected = Math.ulp(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.copySign.exec()

          EvalFunc<DataAtom> copySign = new copySign();
          Tuple tup = new Tuple(2);
          tup.setField(0, -0.5);
          tup.setField(1,0.6);
          DataAtom output = new DataAtom();
          copySign.exec(tup, output);
          double expected = Math.copySign(-0.5,0.6);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
  
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.