当前位置:网站首页>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
边栏推荐
- owl.carousel海报卡片Slider轮播切换
- what is bsp in rtems
- 【C语言】头文件#include <conio.h>,conio是Console Input/Output(控制台输入输出)
- 「时序数据库」使用cassandra进行时间序列数据扫描
- Mobile and PC compatible loading and toast message plugins
- 关于json转换器缺失的问题,报错内容:No converter found for return value of type
- "Data Strategy" Results-Driven Enterprise Data Strategy: Organization and Governance
- 2022.8.8-----leetcode.761
- 面试官:项目中 Dao、Service、Controller、Util、Model 怎么划分的?
- getParameter()与 getAttribute()的用法与区别
猜你喜欢
谷歌数据中心发生“电力事故”造成 3 人受伤
第2章-矩阵及其运算-矩阵创建(1)
第2章-矩阵及其运算-矩阵运算(2)
第3章-线性方程组(3)
What is an abstract class
Situation丨The intrusion of hackers intensifies, and the shooting range sets up a "defense shield" for network security
AUTOCAD——减少样条曲线控制点数、CAD进阶练习(三)
runtime-core.esm-bundler.js?d2dd:218 Uncaught TypeError: formRef.value?.validate is not a function
ESP8266 Tutorial 1 - Introduction to ESP8266 Hardware Platform
Redis (three) - detailed configuration file, publish and subscribe, new data types
随机推荐
面试官:项目中 Dao、Service、Controller、Util、Model 怎么划分的?
Short video software development - how to break the platform homogenization
bus事件总线 使用
OneFlow source code parsing: operator instructions executed in a virtual machine
GPU accelerated Pinterest recommendation model, the number of parameters increased by 100 times, and the user activity increased by 16%
2022.8.8-----leetcode.761
HDU 1520 Anniversary party (树型dp)
POJ 3101 Astronomy (数学)
Situation丨The intrusion of hackers intensifies, and the shooting range sets up a "defense shield" for network security
【无标题】
交换 生成树 知识总结
chart.js horizontal column chart plugin
Text selection rounded style border-radius
越折腾越好用的 3 款开源 APP
「时序数据库」使用cassandra进行时间序列数据扫描
Several small projects that I have open sourced over the years
CodeChef STMRRG String Merging (dp)
C语言空白符、空格符 与转义字符题点总结
FastReport.Net 2022.2.17 Crack
Taro小程序跨端开发入门实战