View | Details | Raw Unified | Return to bug 55043
Collapse All | Expand All

(-)poi/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java (-8 / +6 lines)
Lines 15-23 Link Here
15
import org.apache.poi.ss.formula.eval.ValueEval;
15
import org.apache.poi.ss.formula.eval.ValueEval;
16
import org.apache.poi.ss.formula.function.FunctionMetadata;
16
import org.apache.poi.ss.formula.function.FunctionMetadata;
17
import org.apache.poi.ss.formula.function.FunctionMetadataRegistry;
17
import org.apache.poi.ss.formula.function.FunctionMetadataRegistry;
18
import org.apache.poi.ss.formula.functions.EDate;
18
import org.apache.poi.ss.formula.functions.*;
19
import org.apache.poi.ss.formula.functions.FreeRefFunction;
20
import org.apache.poi.ss.formula.functions.Sumifs;
21
import org.apache.poi.ss.formula.udf.UDFFinder;
19
import org.apache.poi.ss.formula.udf.UDFFinder;
22
20
23
import java.util.*;
21
import java.util.*;
Lines 72-80 Link Here
72
        r(m, "BESSELK", null);
70
        r(m, "BESSELK", null);
73
        r(m, "BESSELY", null);
71
        r(m, "BESSELY", null);
74
        r(m, "BIN2DEC", null);
72
        r(m, "BIN2DEC", null);
75
        r(m, "BIN2HEX", null);
73
        r(m, "BIN2HEX", Bin2Hex.instance);
76
        r(m, "BIN2OCT", null);
74
        r(m, "BIN2OCT", null);
77
        r(m, "COMPLEX", null);
75
        r(m, "COMPLEX", Complex.instance);
78
        r(m, "CONVERT", null);
76
        r(m, "CONVERT", null);
79
        r(m, "COUNTIFS", null);
77
        r(m, "COUNTIFS", null);
80
        r(m, "COUPDAYBS", null);
78
        r(m, "COUPDAYBS", null);
Lines 93-101 Link Here
93
        r(m, "CUMIPMT", null);
91
        r(m, "CUMIPMT", null);
94
        r(m, "CUMPRINC", null);
92
        r(m, "CUMPRINC", null);
95
        r(m, "DEC2BIN", null);
93
        r(m, "DEC2BIN", null);
96
        r(m, "DEC2HEX", null);
94
        r(m, "DEC2HEX", Dec2Hex.instance);
97
        r(m, "DEC2OCT", null);
95
        r(m, "DEC2OCT", null);
98
        r(m, "DELTA", null);
96
        r(m, "DELTA", Delta.instance);
99
        r(m, "DISC", null);
97
        r(m, "DISC", null);
100
        r(m, "DOLLARDE", null);
98
        r(m, "DOLLARDE", null);
101
        r(m, "DOLLARFR", null);
99
        r(m, "DOLLARFR", null);
Lines 150-156 Link Here
150
        r(m, "PRICE", null);
148
        r(m, "PRICE", null);
151
        r(m, "PRICEDISC", null);
149
        r(m, "PRICEDISC", null);
152
        r(m, "PRICEMAT", null);
150
        r(m, "PRICEMAT", null);
153
        r(m, "QUOTIENT", null);
151
        r(m, "QUOTIENT", Quotient.instance);
154
        r(m, "RANDBETWEEN", RandBetween.instance);
152
        r(m, "RANDBETWEEN", RandBetween.instance);
155
        r(m, "RECEIVED", null);
153
        r(m, "RECEIVED", null);
156
        r(m, "RTD", null);
154
        r(m, "RTD", null);
(-)poi/src/testcases/org/apache/poi/ss/formula/functions/TestQuotient.java (-1 / +1 lines)
Lines 58-63 Link Here
58
        confirmValueError("numerator is nonnumeric", "ABCD", "", ErrorEval.VALUE_INVALID);
58
        confirmValueError("numerator is nonnumeric", "ABCD", "", ErrorEval.VALUE_INVALID);
59
        confirmValueError("denominator is nonnumeric", "", "ABCD", ErrorEval.VALUE_INVALID);
59
        confirmValueError("denominator is nonnumeric", "", "ABCD", ErrorEval.VALUE_INVALID);
60
60
61
        confirmValueError("denominator is nonnumeric", "3.14159", "0", ErrorEval.DIV_ZERO);
61
        confirmValueError("dividing by zero", "3.14159", "0", ErrorEval.DIV_ZERO);
62
    }
62
    }
63
}
63
}
(-)poi/src/java/org/apache/poi/ss/formula/functions/Quotient.java (-1 / +13 lines)
Lines 1-5 Link Here
1
package org.apache.poi.ss.formula.functions;
1
package org.apache.poi.ss.formula.functions;
2
2
3
import org.apache.poi.ss.formula.OperationEvaluationContext;
3
import org.apache.poi.ss.formula.eval.ValueEval;
4
import org.apache.poi.ss.formula.eval.ValueEval;
4
5
5
6
Lines 22-28 Link Here
22
 *
23
 *
23
 * @author cedric dot walter @ gmail dot com
24
 * @author cedric dot walter @ gmail dot com
24
 */
25
 */
25
public class Quotient extends Fixed2ArgFunction {
26
public class Quotient extends Fixed2ArgFunction implements FreeRefFunction {
27
28
    public static final FreeRefFunction instance = new Quotient();
29
26
    @Override
30
    @Override
27
    public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval venumerator, ValueEval vedenominator) {
31
    public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval venumerator, ValueEval vedenominator) {
28
32
Lines 45-49 Link Here
45
        }
49
        }
46
50
47
        return new StringEval(String.valueOf((int)(enumerator / denominator)));
51
        return new StringEval(String.valueOf((int)(enumerator / denominator)));
52
    }
53
54
    @Override
55
    public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
56
        if (args.length != 2) {
57
            return ErrorEval.VALUE_INVALID;
58
        }
59
        return evaluate(ec.getRowIndex(), ec.getColumnIndex(), args[0], args[1]);
48
    }
60
    }
49
}
61
}

Return to bug 55043