Java Double类doubleToLongBits()方法与示例
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()方法与示例相关推荐
- java中double..compare_Java Double类compare()方法与示例
Double类compare()法compare()方法在java.lang包中可用. compare()方法用于检查给定两个双精度值的相等或不相等,换句话说,可以说此方法用于比较两个双精度值. co ...
- java annotation class,Java Class类 isAnnotation()方法及示例
Class类isAnnotation()方法isAnnotation()方法在java.lang包中可用. isAnnotation()方法用于检查此Class对象是否表示注释类型. isAnnota ...
- java字符类型的返回值,Java字符类isWhitespace()方法及示例
Character 类isWhitespace()法isWhitespace()方法在java.lang包中可用. isWhitespace()方法用于检查给定的char值是否为空格,但是它包含空格中 ...
- Java Double类parseDouble()方法的示例
Double类parseDouble()方法 (Double class parseDouble() method) parseDouble() method is available in java ...
- java日历类add方法_Java日历computeTime()方法及示例
java日历类add方法 日历类computeTime()方法 (Calendar Class computeTime() method) computeTime() method is availa ...
- java日历类add方法_Java日历computeFields()方法及示例
java日历类add方法 日历类的computeFields()方法 (Calendar Class computeFields() method) computeFields() method is ...
- java日历类add方法_Java日历setFirstDayOfWeek()方法与示例
java日历类add方法 日历类setFirstDayOfWeek()方法 (Calendar Class setFirstDayOfWeek() method) setFirstDayOfWeek( ...
- java日历类add方法_Java日历setMinimalDaysInFirstWeek()方法与示例
java日历类add方法 日历类setMinimalDaysInFirstWeek()方法 (Calendar Class setMinimalDaysInFirstWeek() method) se ...
- math的用法在java中的使用,Java Math cbrt() 使用方法及示例
Java Math cbrt() 使用方法及示例 Java Math cbrt()方法返回指定数字的立方根. cbrt()方法的语法为: Math.cbrt(double num) 注意:cbrt() ...
最新文章
- 数据挖掘(Data Mining)| 数据分析建模理论基础
- Java的CountDownLatch和CyclicBarrier的理解和区别
- 【经典书】线性代数与应用(附pdf)
- Spring-属性文件自身的引用03
- suid shell
- Zencart 给DHL运费模块增加一个分区的方法
- c语言error和,C语言ERROR精选.doc
- [bzoj2850]巧克力王国_KD-Tree
- 3年后,基于mysql控制vsftp的用户认证机制
- 面试时,如何巧妙回答跳槽问题
- PDFMiner 操作 PDF 文件
- 网络新手ip隐藏器 v1.10 官方
- cachecloud安装指南
- 一、Photoshop新版本(2019以后)常用快捷键总结、归纳
- mtk android内核代码,mtk log系统详解
- android没有adm_Android--Android Studio 打开ADM报错
- 说说教育机构教学课程视频加密是如何实现的?
- ubuntu下查看硬件信息等指令整理,安装并简单运行HotSpot
- Docker你入门了吗?一套骚指令带你入门!
- vs 2019+linux跨平台开发中的sqlite3数据库环境配置