双倍到长而不用转换Java [英] double to long without conversion in Java

查看:150
本文介绍了双倍到长而不用转换Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将双倍变成长保存其二进制结构,而不是数字值。只需更改类型,但保留二进制值。有没有原生的方式来做?

I need to turn double into long preserving its binary structure, not number value. Just change type, but leave binary value as it is. Is there a native way to do it?

推荐答案

Double 与doubleToLongBits和doubleToLongRawBits。 Javadoc是您的朋友。

There is Double with to doubleToLongBits and doubleToLongRawBits. Javadoc is your friend.

这篇关于双倍到长而不用转换Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆