java Math.pow
2021/11/27 9:10:40
本文主要是介绍java Math.pow,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
Math.pow
/** * Returns the value of the first argument raised to the power of the * second argument. Special cases: * * <ul><li>If the second argument is positive or negative zero, then the * result is 1.0. * <li>If the second argument is 1.0, then the result is the same as the * first argument. * <li>If the second argument is NaN, then the result is NaN. * <li>If the first argument is NaN and the second argument is nonzero, * then the result is NaN. * * <li>If * <ul> * <li>the absolute value of the first argument is greater than 1 * and the second argument is positive infinity, or * <li>the absolute value of the first argument is less than 1 and * the second argument is negative infinity, * </ul> * then the result is positive infinity. * * <li>If * <ul> * <li>the absolute value of the first argument is greater than 1 and * the second argument is negative infinity, or * <li>the absolute value of the * first argument is less than 1 and the second argument is positive * infinity, * </ul> * then the result is positive zero. * * <li>If the absolute value of the first argument equals 1 and the * second argument is infinite, then the result is NaN. * * <li>If * <ul> * <li>the first argument is positive zero and the second argument * is greater than zero, or * <li>the first argument is positive infinity and the second * argument is less than zero, * </ul> * then the result is positive zero. * * <li>If * <ul> * <li>the first argument is positive zero and the second argument * is less than zero, or * <li>the first argument is positive infinity and the second * argument is greater than zero, * </ul> * then the result is positive infinity. * * <li>If * <ul> * <li>the first argument is negative zero and the second argument * is greater than zero but not a finite odd integer, or * <li>the first argument is negative infinity and the second * argument is less than zero but not a finite odd integer, * </ul> * then the result is positive zero. * * <li>If * <ul> * <li>the first argument is negative zero and the second argument * is a positive finite odd integer, or * <li>the first argument is negative infinity and the second * argument is a negative finite odd integer, * </ul> * then the result is negative zero. * * <li>If * <ul> * <li>the first argument is negative zero and the second argument * is less than zero but not a finite odd integer, or * <li>the first argument is negative infinity and the second * argument is greater than zero but not a finite odd integer, * </ul> * then the result is positive infinity. * * <li>If * <ul> * <li>the first argument is negative zero and the second argument * is a negative finite odd integer, or * <li>the first argument is negative infinity and the second * argument is a positive finite odd integer, * </ul> * then the result is negative infinity. * * <li>If the first argument is finite and less than zero * <ul> * <li> if the second argument is a finite even integer, the * result is equal to the result of raising the absolute value of * the first argument to the power of the second argument * * <li>if the second argument is a finite odd integer, the result * is equal to the negative of the result of raising the absolute * value of the first argument to the power of the second * argument * * <li>if the second argument is finite and not an integer, then * the result is NaN. * </ul> * * <li>If both arguments are integers, then the result is exactly equal * to the mathematical result of raising the first argument to the power * of the second argument if that result can in fact be represented * exactly as a {@code double} value.</ul> * * <p>(In the foregoing descriptions, a floating-point value is * considered to be an integer if and only if it is finite and a * fixed point of the method {@link #ceil ceil} or, * equivalently, a fixed point of the method {@link #floor * floor}. A value is a fixed point of a one-argument * method if and only if the result of applying the method to the * value is equal to the value.) * * <p>The computed result must be within 1 ulp of the exact result. * Results must be semi-monotonic. * * @param a the base. * @param b the exponent. * @return the value {@code a}<sup>{@code b}</sup>. */ public static double pow(double a, double b) { return StrictMath.pow(a, b); // default impl. delegates to StrictMath }
#################################
这篇关于java Math.pow的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-06-05做软件测试需要懂代码吗?
- 2024-06-0514-ShardingSphere的分布式主键实现
- 2024-06-03为什么以及如何要进行架构设计权衡?
- 2024-05-31全网首发第二弹!软考2024年5月《软件设计师》真题+解析+答案!(11-20题)
- 2024-05-31全网首发!软考2024年5月《软件设计师》真题+解析+答案!(21-30题)
- 2024-05-30【Java】百万数据excel导出功能如何实现
- 2024-05-30我们小公司,哪像华为一样,用得上IPD(集成产品开发)?
- 2024-05-30java excel上传--poi
- 2024-05-30安装笔记本应用商店的pycharm,再安排pandas等模块,说是没有打包工具?
- 2024-05-29java11新特性