strictmath

StrictMath类log10()方法 (StrictMath Class log10() method)

  • log10() method is available in java.lang package.

    log10()方法在java.lang包中可用。

  • log10() method is used to return the logarithm of the given (base 10) of the given argument in the method.

    log10()方法用于返回方法中给定参数的给定(以10为底)的对数。

  • log10() method is a static method so it is accessible with the class name and if we try to access the method with the class object then we will not get any error.

    log10()方法是静态方法,因此可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会出现任何错误。

  • log10() method does not throw any exception.

    log10()方法不会引发任何异常。

Syntax:

句法:

    public static double log10(double d);

Parameter(s):

参数:

  • double d – represents the double type argument.

    double d –表示double类型的参数。

Return value:

返回值:

The return type of this method is double – it returns the logarithm (base 10) of the given argument.

此方法的返回类型为double-返回给定参数的对数(以10为底)。

Note:

注意:

  • If we pass NaN, method returns NaN.

    如果传递NaN,则方法返回NaN。

  • If we pass a value which is equal to 10*N (Here, N is an integer value), method returns the N.

    如果我们传递的值等于10 * N (此处N是整数值),则方法返回N。

  • If we pass a positive infinity, method returns the same (i.e. positive infinity).

    如果我们传递一个正无穷大,则方法将返回相同的值(即正无穷大)。

  • If we pass 0 (negative or positive), method returns the negative infinity.

    如果传递0(负数或正数),则方法将返回负无穷大。

Example:

例:

// Java program to demonstrate the example of
// log10(double d) method of StrictMath Class.
public class Log10 {public static void main(String[] args) {// variable declarations
double d1 = 7.0 / 0.0;
double d2 = -0.0;
double d3 = 6054.2;
// Display previous value of d1,d2,d3
System.out.println("d1: " + d1);
System.out.println("d2: " + d2);
System.out.println("d3: " + d3);
// Here , we will get (Infinity) because we are
// passing parameter whose value is (-infinity)
System.out.println("StrictMath.log10(d1): " + StrictMath.log10(d1));
// Here , we will get (-Infinity) because we are
// passing parameter whose value is (-0.0)
System.out.println("StrictMath.log10(d2): " + StrictMath.log10(d2));
// Here , we will get (log [10 raised to the power of the given argument])
// and we are passing parameter whose value is (6054.2)
System.out.println("StrictMath.log10(d3): " + StrictMath.log10(d3));
}
}

Output

输出量

d1: Infinity
d2: -0.0
d3: 6054.2
StrictMath.log10(d1): Infinity
StrictMath.log10(d2): -Infinity
StrictMath.log10(d3): 3.782056763740091

翻译自: https://www.includehelp.com/java/strictmath-log10-method-with-example.aspx

strictmath

strictmath_Java StrictMath log10()方法与示例相关推荐

  1. java hypot_Java StrictMath hypot()方法与示例

    StrictMath类hypot()方法hypot()方法在java.lang包中可用. hypot()方法用于返回sqrt(sq(d1)+ sq(d2))的平方根,而不进行任何中间运算,换句话说,它 ...

  2. java math.log10_Java Math log10() 使用方法及示例

    Java Math log10() 使用方法及示例 Java Math log10()方法计算指定值的以10为底的对数,然后将其返回. log10()方法的语法为: Math.log10(double ...

  3. java abs在哪个包,Java StrictMath abs()方法

    Java StrictMath abs()方法 java.lang.StrictMath.abs(float a) 方法返回一个浮点值的绝对值.如果参数不是负数,则返回该参数.如果参数为负数,则返回该 ...

  4. python nextpow2_Python signal.hann方法代码示例

    本文整理汇总了Python中scipy.signal.hann方法的典型用法代码示例.如果您正苦于以下问题:Python signal.hann方法的具体用法?Python signal.hann怎么 ...

  5. java hypot_Java StrictMath hypot()方法

    Java StrictMath hypot()方法 java.lang.StrictMath.hypot() 方法返回 sqrt(x2 + y2) 没有中间溢或下溢.它包括了一些情况: 如果任一参数为 ...

  6. python boxcox1p_Python mpmath.mpf方法代码示例

    本文整理汇总了Python中mpmath.mpf方法的典型用法代码示例.如果您正苦于以下问题:Python mpmath.mpf方法的具体用法?Python mpmath.mpf怎么用?Python ...

  7. .net连接mysql数据_.net连接MYSQL数据库的方法及示例!

    连接MYSQL数据库的方法及示例 方法一: 使用MYSQL推出的MySQL Connector/Net is an ADO.NET driver for MySQL 该组件为MYSQL为ADO.NET ...

  8. set.difference() 的用法(python3)_Python 集合 difference_update() 使用方法及示例

    Python 集合 difference_update() 使用方法及示例 Difference_update()使用集合的差集更新集合,并调用difference_update()方法. 如果A和B ...

  9. doc python 颜色_Python wordcloud.ImageColorGenerator方法代码示例

    本文整理汇总了Python中wordcloud.ImageColorGenerator方法的典型用法代码示例.如果您正苦于以下问题:Python wordcloud.ImageColorGenerat ...

最新文章

  1. Effective Java 之个人总结
  2. 代码注入之远程线程篇
  3. Hadoop集群中运行MapReduce程序错误记录
  4. 【Python】tqdm创建进度条
  5. pythonenumapi_Python调用windows API实现屏幕截图
  6. C++ Rand()各种实现
  7. realloc函_[转载]realloc函数的使用及注意事项(转)
  8. 自动/持续部署Docker 的tomcat web项目(二)
  9. html文件转换成dwt文件,如何把dwt页面转换成html页面
  10. ORACLE EXPLAIN PLAN的总结 (优化SQL语句)
  11. 生命的书写,梦想的呈现
  12. hdu2844 Coins -----多重背包+二进制优化
  13. linux三剑客之awk
  14. Verilog设计参数化的译码器与编码器,以及设计4位格雷码计数器
  15. hadoop原理示意图
  16. python爬虫— 利用js2xml 获取 script 数据
  17. 股权的秘密:如何把握公司的控制权
  18. 【ZJOJ1321】灯
  19. Python爬取《你好李焕英》猫眼实时票房
  20. 阿里巴巴的类ChatGPT产品

热门文章

  1. 前端工程师必备谷歌浏览器F12下的调试知识点
  2. step7db块寻址_step7中的难点:间接寻址示例,中文详细注释。
  3. oracle日志文件大小规则,修改oracle日志文件大小
  4. uniapp uni.request GET方式请求,不能直接传数组解决方法
  5. 利用canvas来绘制一个会动的图画
  6. 滚动条判断是否滑动到顶部底部
  7. 关于使用JQ scrollTop方法进行滚动定位
  8. CSS3与页面布局学习笔记(二)——盒子模型(Box Model)、边距折叠、内联与块标签、CSSReset
  9. 聊聊一直困扰前端程序员的浏览器兼容-【css】
  10. [欧拉函数] Bzoj P2186 沙拉公主的困惑