当前位置:网站首页>Double.doubleToLongBits() method uses
Double.doubleToLongBits() method uses
2022-08-10 11:08:00 【zhangjianming2018】
This method can convert double type data into long type data, so that the double type data can be judged according to the long method (<,>, ==).
Example:
Double.doubleToLongBits(10.00) == Double.doubleToLongBits(10.00)
Double.doubleToLongBits(20.00) > Double.doubleToLongBits(10.00)
Double.doubleToLongBits(10.00) < Double.doubleToLongBits(20.00)
Double class longBitsToDouble() method (Double class longBitsToDouble() method)
longBitsToDouble() method is available in java.lang package.
longBitsToDouble() method is available in java.lang package.
longBitsToDouble() method is used to return the double value corresponding to the given long bit denotation followed by IEEE 754 double floating-point standards.
longBitsToDouble() method returns the double precision value corresponding to the given long bit symbol, followed by the IEEE 754 double floating point standard. longBitsToDouble() 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.
The longBitsToDouble() method is a static method and can also be accessed using the class name, and if you try to access the method using the class object, you will not get an error.
longBitsToDouble() method does not throw an exception at the time of representing bits.
longBitsToDouble() method does not throw an exception at the time of representing bits.
longBitsToDouble() methoddoes not throw an exception.
Syntax:
Syntax
public static double longBitsToDouble(long bits_rep);
Parameter(s):
Parameters:
long bits_rep – represents the long integer value.
long bits_rep – represents the long integer value.
Return value:
Return value:
The return type of this method is double, it returns the bits that represent the long integer value.
The return type of this method is double, which returns the bits representing the long value.
Note:
Note:
If we pass "0x7ff0000000000000L", it returns the value "positive infinity".
If we pass "0x7ff0000000000000L" which will return the value "positive infinity".
If we pass "0xfff0000000000000L", it returns the value "negative infinity".
If we pass "0xfff0000000000000L" which will return the value "negative infinity".
// Java program to demonstrate the example// of longBitsToDouble(long bits_rep)// method of Double classpublic class LongBitsToDoubleOfDoubleClass {public static void main(String[] args) {// Variables initializationdouble d1 = 18.20;double d2 = 19.20;// Display value1,value2 valuesSystem.out.println("d1: " + d1);System.out.println("d2: " + d2);// Double instance creationDouble value1 = new Double(d1);Double value2 = new Double(d2);// It returns the double value denoted by the given bit denotation//by calling value1.longBitsToDouble(124568)double result1 = value1.longBitsToDouble(124568);// It returns the double value denoted by the given bit denotation//by calling value1.longBitsToDouble(124568)double result2 = value2.longBitsToDouble(0xfff0000000000000L);// Display result1,result2 valuesSystem.out.println("value1.longBitsToDouble(124568): " + result1);System.out.println("value2.longBitsToDouble(0xfff0000000000000L): " + result2);}}
d1: 18.2d2: 19.2value1.longBitsToDouble(124568): 6.1545E-319value2.longBitsToDouble(0xfff0000000000000L): -Infinity
边栏推荐
猜你喜欢
What is an abstract class
8月份DB-Engines 数据库排行榜最新战况
Flutter实战-请求封装(五)之Isolate线程改造
ISO9001在讲什么?过程方法和风险思维
兼容移动和PC的loading加载和toast消息插件
动作捕捉系统用于室内组合定位技术研究
[Concept of Theory of Knowledge] "Progress in the Theory of Reason" University of Leuven 2022 latest 220-page doctoral dissertation
「时序数据库」使用cassandra进行时间序列数据扫描
The impact of development mode on testing
第3章-线性方程组(3)
随机推荐
交换 生成树 知识总结
ZZULIOJ 1124: 两个有序数组合并
2022.8.9-----leetcode.1413
4 面拿华为 offer 的水平,面试阿里居然一面就被吊打?
内存问题难定位,那是因为你没用ASAN
TCP/IP笔记
ESP8266 Tutorial 2 - Burn AT Firmware
database constraints
GPU加速Pinterest推荐模型,参数量增加100倍,用户活跃度提高16%
getParameter()与 getAttribute()的用法与区别
Summary of whitespace, space and escape characters in C language
chart.js horizontal column chart plugin
PTA 7-2 Summation and Counting of Diagonal Elements of Square Matrices Solution
"Time Series Database" uses cassandra to scan time series data
MongoDB数据库笔记
Codeforces 814 C. An impassioned circulation of affection (dp)
Redis(三)——配置文件详解、发布和订阅、新数据类型
Interviewer: Dao, in Service, the Controller, Util, divided into the Model?
Gartner reiterates the important value of 'data weaving'
dedecms supports one-click upload of Word content