java.lang.Math#rint ( )源码实例Demo

下面列出了java.lang.Math#rint ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Llunatic   文件: Round.java
private Object round(Object l, Object r) throws ParseException {
	if (l instanceof Number && r instanceof Number)
	{
		int dp = ((Number)r).intValue();
		double val = ((Number)l).doubleValue();
		double mul = Math.pow(10,dp);
		return new Double(Math.rint(val*mul)/mul);
	}
	throw new ParseException("Invalid parameter type");
}
 
源代码2 项目: Llunatic   文件: Round.java
public Object round(Object param)
	throws ParseException
{
	if (param instanceof Number)
	{
		return new Double(Math.rint(((Number)param).doubleValue()));
	}

	throw new ParseException("Invalid parameter type");
}
 
源代码3 项目: incubator-retired-mrql   文件: SystemFunctions.java
public static MR_double rint ( MR_double x ) { return new MR_double(Math.rint(x.get())); }