svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / function / numeric / TanhFunction.java @ 44207
History | View | Annotate | Download (592 Bytes)
1 | 43512 | jjdelcerro | package org.gvsig.expressionevaluator.impl.function.numeric; |
---|---|---|---|
2 | |||
3 | import org.apache.commons.lang3.Range; |
||
4 | 43521 | jjdelcerro | import org.gvsig.expressionevaluator.Interpreter; |
5 | 43512 | jjdelcerro | import org.gvsig.expressionevaluator.spi.AbstractFunction; |
6 | |||
7 | public class TanhFunction extends AbstractFunction { |
||
8 | |||
9 | public TanhFunction() {
|
||
10 | 43518 | jjdelcerro | super("Numeric", "TANH", Range.is(1)); |
11 | 43512 | jjdelcerro | } |
12 | |||
13 | @Override
|
||
14 | 44009 | jjdelcerro | public boolean allowConstantFolding() { |
15 | return true; |
||
16 | } |
||
17 | |||
18 | @Override
|
||
19 | 43521 | jjdelcerro | public Object call(Interpreter interpreter, Object[] args) { |
20 | 43512 | jjdelcerro | double r = Math.tanh(getDouble(args, 0)); |
21 | return r;
|
||
22 | } |
||
23 | } |