ceil.java

来自「JAVA 数学程序库 提供常规的数值计算程序包」· Java 代码 · 共 43 行

JAVA
43
字号
package jmathlib.toolbox.jmathlib.matrix;

import jmathlib.core.functions.ExternalElementWiseFunction;

public class ceil extends ExternalElementWiseFunction
{
    
    public ceil()
    {
        name = "ceil";
    }
    
    /**Standard functions - rounds the value up   
    @return the result as a double array
    */
    public double[] evaluateValue(double[] arg)
    {
        double[] result = new double[2];

        result[REAL] = Math.ceil(arg[REAL]);
        result[IMAG] = Math.ceil(arg[IMAG]);
        
        return  result;                      
    }

}

/*
@GROUP
@GROUP
general
@SYNTAX
ceil(value)
@DOC
Rounds the value of the first operand up to the nearest integer
@EXAMPLES
ceil(-5.5) = -5
ceil(2.3)   = 3
@SEE
floor, round
*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?