Initial import into git.
[galago.git] / java / pig-galago / src / com / yahoo / pig / builtin / DIVIDE.java
blob6438abaf53da917196babfece06c00436440176f
1 /*
2 * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
3 * See accompanying LICENSE file.
4 */
5 package com.yahoo.pig.builtin;
7 import java.io.IOException;
9 import com.yahoo.pig.AtomEvalFunc;
10 import com.yahoo.pig.data.DataAtom;
11 import com.yahoo.pig.data.Tuple;
13 public class DIVIDE extends AtomEvalFunc {
15 @Override
16 public void exec(Tuple input, DataAtom output) throws IOException {
17 double v1 = input.getAtomField(0).numval();
18 double v2 = input.getAtomField(1).numval();
19 output.setValue(v1/v2);