⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strictmath.java

📁 一个开源的JAVA虚拟机
💻 JAVA
字号:
/*    libaegisvm - The Aegis Virtual Machine for executing Java bytecode    Copyright (C) 2001-2002  Philip W. L. Fong    This library is free software; you can redistribute it and/or    modify it under the terms of the GNU Lesser General Public    License as published by the Free Software Foundation; either    version 2.1 of the License, or (at your option) any later version.    This library is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public    License along with this library; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/package java.lang;import java.util.Random;public final class StrictMath {    private static Random rg = null;    private StrictMath() { }    public static final double E =	Double.longBitsToDouble(0x4005bf0a8b145769L);    public static final double PI =	Double.longBitsToDouble(0x400921fb54442d18L);    public static double sin(double a) {	return Math.sin(a);    }    public static double cos(double a) {	return Math.cos(a);    }    public static double tan(double a) {	return Math.tan(a);    }    public static double asin(double a) {	return Math.asin(a);    }    public static double acos(double a) {	return Math.acos(a);    }    public static double atan(double a) {	return Math.atan(a);    }    public static double toRadians(double angdeg) {	return Math.toRadians(angdeg);    }    public static double toDegrees(double angrad) {	return Math.toDegrees(angrad);    }    public static double exp(double a) {	return Math.exp(a);    }    public static double log(double a) {	return Math.log(a);    }    public static double sqrt(double a) {	return Math.sqrt(a);    }    public static double IEEEremainder(double f1, double f2) {	return Math.IEEEremainder(f1, f2);    }    public static double ceil(double a) {	return Math.ceil(a);    }    public static double floor(double a) {	return Math.floor(a);    }    public static double rint(double a) {	return Math.rint(a);    }    public static double atan2(double a, double b) {	return Math.atan2(a, b);    }    public static double pow(double a, double b) {	return Math.pow(a, b);    }    public static int round(float a) {	return Math.round(a);    }    public static long round(double a) {	return Math.round(a);    }        public static synchronized double random() {	if (rg == null)	    rg = new Random();	return rg.nextDouble();    }    public static int abs(int a) {	return (a < 0) ? -a : a;    }    public static long abs(long a) {	return (a < 0) ? -a : a;    }    public static float abs(float a) {	return Float.intBitsToFloat(0x7fffffff & Float.floatToIntBits(a));    }    public static double abs(double a) {	return Double.longBitsToDouble((Double.doubleToLongBits(a)<<1)>>>1);    }    public static int max(int a, int b) {	return (a > b) ? a : b;    }    public static long max(long a, long b) {	return (a > b) ? a : b;    }    public static float max(float a, float b) {	if (a != a || b != b)	    return Float.NaN;	else if (a == 0.0f && b == 0.0f)	    return (1.0f / a > 0.0f) ? a : b;	else	    return (a > b) ? a : b;    }    public static double max(double a, double b) {	if (a != a || b != b)	    return Double.NaN;	else if (a == 0.0d && b == 0.0d)	    return (1.0d / a > 0.0d) ? a : b;	else	    return (a > b) ? a : b;    }    public static int min(int a, int b) {	return (a < b) ? a : b;    }    public static long min(long a, long b) {	return (a < b) ? a : b;    }    public static float min(float a, float b) {	if (a != 0 || b != b)	    return Float.NaN;	else if (a == 0.0f && b == 0.0f)	    return (1.0f / a < 0.0f) ? a : b;	else	    return (a < b) ? a : b;    }    public static double min(double a, double b) {	if (a != 0 || b != b)	    return Double.NaN;	else if (a == 0.0d && b == 0.0d)	    return (1.0d / a < 0.0d) ? a : b;	else	    return (a < b) ? a : b;    }}

⌨️ 快捷键说明

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