Double类doubleToLongBits()方法 (Double class doubleToLongBits() method)

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

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

  • doubleToLongBits() method follows IEEE 754 double floating-point standards and according to standards, it returns the bits that denote floating-point value.

    doubleToLongBits()方法遵循IEEE 754双浮点标准,并且根据这些标准,它返回表示浮点值的位。

  • doubleToLongBits() method is a static method, it is accessible with the class name too and if we try to access the method with the class object then also we will not get an error.

    doubleToLongBits()方法是一个静态方法,也可以使用类名进行访问,如果我们尝试使用类对象访问该方法,那么也不会收到错误。

  • doubleToLongBits() method does not throw an exception at the time of representing bits.

    doubleToLongBits()方法在表示位时不会引发异常。

Syntax:

句法:

    public static long doubleToLongBits(double value);

Parameter(s):

参数:

  • double value – This parameter represents the double precision floating point value.

    double value –此参数表示双精度浮点值。

Return value:

返回值:

The return type of this method is long, it returns the bits that represent the double precision floating-point value.

此方法的返回类型为long ,它返回表示双精度浮点值的位。

Note:

注意:

  • If we pass positive infinity, it returns the value 0x7ff0000000000000L.

    如果我们传递正无穷大 ,它将返回值0x7ff0000000000000L

  • If we pass negative infinity, it returns the value 0xfff0000000000000L.

    如果我们传递负无穷大 ,它将返回值0xfff0000000000000L

  • If we pass NaN, it returns the value 0x7ff8000000000000L.

    如果我们通过NaN ,它将返回值0x7ff8000000000000L

Example:

例:

// Java program to demonstrate the example
// of doubleToLongBits(double value)
// method of Double class
public class DoubleToLongBitsOfDoubleClass {public static void main(String[] args) {// Variables initialization
double value1 = 18.20;
double value2 = 19.20;
// Display value1,value2 values
System.out.println("value1: " + value1);
System.out.println("value2: " + value2);
// It returns the bits denoted by the double
// floating-point argument by calling
// Double.doubleToLongBits(value1)
long result1 = Double.doubleToLongBits(value1);
// It returns the bits denoted by the double
// floating-point argument by calling
// Double.doubleToLongBits(value2)
long result2 = Double.doubleToLongBits(value2);
// Display result1,result2 values
System.out.println("Double.doubleToLongBits(value1): " + result1);
System.out.println("Double.doubleToLongBits(value2): " + result2);
}
}

Output

输出量

value1: 18.2
value2: 19.2
Double.doubleToLongBits(value1): 4625816062258262835
Double.doubleToLongBits(value2): 4626097537234973491

翻译自: https://www.includehelp.com/java/double-class-doubletolongbits-method-with-example.aspx

Java Double类doubleToLongBits()方法与示例相关推荐

  1. java中double..compare_Java Double类compare()方法与示例

    Double类compare()法compare()方法在java.lang包中可用. compare()方法用于检查给定两个双精度值的相等或不相等,换句话说,可以说此方法用于比较两个双精度值. co ...

  2. java annotation class,Java Class类 isAnnotation()方法及示例

    Class类isAnnotation()方法isAnnotation()方法在java.lang包中可用. isAnnotation()方法用于检查此Class对象是否表示注释类型. isAnnota ...

  3. java字符类型的返回值,Java字符类isWhitespace()方法及示例

    Character 类isWhitespace()法isWhitespace()方法在java.lang包中可用. isWhitespace()方法用于检查给定的char值是否为空格,但是它包含空格中 ...

  4. Java Double类parseDouble()方法的示例

    Double类parseDouble()方法 (Double class parseDouble() method) parseDouble() method is available in java ...

  5. java日历类add方法_Java日历computeTime()方法及示例

    java日历类add方法 日历类computeTime()方法 (Calendar Class computeTime() method) computeTime() method is availa ...

  6. java日历类add方法_Java日历computeFields()方法及示例

    java日历类add方法 日历类的computeFields()方法 (Calendar Class computeFields() method) computeFields() method is ...

  7. java日历类add方法_Java日历setFirstDayOfWeek()方法与示例

    java日历类add方法 日历类setFirstDayOfWeek()方法 (Calendar Class setFirstDayOfWeek() method) setFirstDayOfWeek( ...

  8. java日历类add方法_Java日历setMinimalDaysInFirstWeek()方法与示例

    java日历类add方法 日历类setMinimalDaysInFirstWeek()方法 (Calendar Class setMinimalDaysInFirstWeek() method) se ...

  9. math的用法在java中的使用,Java Math cbrt() 使用方法及示例

    Java Math cbrt() 使用方法及示例 Java Math cbrt()方法返回指定数字的立方根. cbrt()方法的语法为: Math.cbrt(double num) 注意:cbrt() ...

最新文章

  1. 数据挖掘(Data Mining)| 数据分析建模理论基础
  2. Java的CountDownLatch和CyclicBarrier的理解和区别
  3. 【经典书】线性代数与应用(附pdf)
  4. Spring-属性文件自身的引用03
  5. suid shell
  6. Zencart 给DHL运费模块增加一个分区的方法
  7. c语言error和,C语言ERROR精选.doc
  8. [bzoj2850]巧克力王国_KD-Tree
  9. 3年后,基于mysql控制vsftp的用户认证机制
  10. 面试时,如何巧妙回答跳槽问题
  11. PDFMiner 操作 PDF 文件
  12. 网络新手ip隐藏器 v1.10 官方
  13. cachecloud安装指南
  14. 一、Photoshop新版本(2019以后)常用快捷键总结、归纳
  15. mtk android内核代码,mtk log系统详解
  16. android没有adm_Android--Android Studio 打开ADM报错
  17. 说说教育机构教学课程视频加密是如何实现的?
  18. ubuntu下查看硬件信息等指令整理,安装并简单运行HotSpot
  19. Docker你入门了吗?一套骚指令带你入门!
  20. vs 2019+linux跨平台开发中的sqlite3数据库环境配置

热门文章

  1. hive分区用2个字段有何限制_Hive分区表和桶表的使用
  2. 扬州大学计算机考研难考吗,扬州大学(专业学位)计算机技术考研难吗
  3. java调用wvsc.exe_c语言 函数的调用方法
  4. js 中对于 css 的变量操作(React也可)
  5. JQ实现情人节表白程序
  6. 前端基础-HTML的的标签详解
  7. excel数据生成sql insert语句
  8. node.js 初体验
  9. NavMeshAgent 动态加载障碍物
  10. 【J2EE设计模式】模型-视图-控制器模式(MVC模式)