久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

原始浮點(diǎn)值如何為-0.0?這意味著什么?

How can a primitive float value be -0.0? What does that mean?(原始浮點(diǎn)值如何為-0.0?這意味著什么?)
本文介紹了原始浮點(diǎn)值如何為-0.0?這意味著什么?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

為什么原始浮點(diǎn)值可以是-0.0?這是什么意思?
我可以取消該功能嗎?

How come a primitive float value can be -0.0? What does that mean?
Can I cancel that feature?

當(dāng)我有:

  float fl;  

然后 fl == -0.0 返回 truefl == 0 也是如此.但是當(dāng)我打印它時(shí),它會(huì)打印 -0.0.

Then fl == -0.0 returns true and so does fl == 0. But when I print it, it prints -0.0.

推薦答案

因?yàn)?Java 使用 IEEE 浮點(diǎn)標(biāo)準(zhǔn)-Point Arithmetic (IEEE 754),它定義了 -0.0 以及何時(shí)應(yīng)該使用它.

Because Java uses the IEEE Standard for Floating-Point Arithmetic (IEEE 754) which defines -0.0 and when it should be used.

可表示的最小數(shù)在次正規(guī)有效數(shù)中沒(méi)有 1 位,由符號(hào)確定,稱為正或 負(fù)零.它實(shí)際上表示在零和相同符號(hào)的最小可表示非零數(shù)之間的范圍內(nèi)的數(shù)字四舍五入到零,這就是它有符號(hào)的原因,以及它的倒數(shù) +Inf 或 -Inf 也有符號(hào).

The smallest number representable has no 1 bit in the subnormal significand and is called the positive or negative zero as determined by the sign. It actually represents a rounding to zero of numbers in the range between zero and the smallest representable non-zero number of the same sign, which is why it has a sign, and why its reciprocal +Inf or -Inf also has a sign.

您可以通過(guò)添加 0.0

例如

Double.toString(value + 0.0);

參見:Java浮點(diǎn)數(shù)的復(fù)雜性

涉及負(fù)零的操作
...
(-0.0) + 0.0 -> 0.0

Operations Involving Negative Zero
...
(-0.0) + 0.0 -> 0.0

-

當(dāng)浮點(diǎn)運(yùn)算導(dǎo)致負(fù)浮點(diǎn)數(shù)非常接近 0 以致無(wú)法正常表示時(shí),會(huì)產(chǎn)生-0.0".

"-0.0" is produced when a floating-point operation results in a negative floating-point number so close to 0 that it cannot be represented normally.

這篇關(guān)于原始浮點(diǎn)值如何為-0.0?這意味著什么?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環(huán)繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動(dòng)生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫(kù))
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對(duì)象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 亚洲自拍偷拍视频 | 91动漫在线观看 | 午夜免费电影院 | 成人午夜在线观看 | 91看片网| 亚洲第一视频网站 | 人人艹人人爽 | 久久成人午夜 | 一区天堂 | 粉嫩av在线 | 亚洲欧洲在线观看视频 | 亚洲男人网 | 日韩小视频在线 | 日本久久精品视频 | 综合一区二区三区 | 免费观看av网站 | 高清一区二区三区 | 黄色一级免费 | 国产国拍亚洲精品av | av免费在线观看网站 | 欧美精品网 | 亚洲精品视频观看 | 中文字字幕在线中文乱码范文 | 日韩精品免费一区 | 日本午夜网站 | 热re99久久精品国产99热 | 精品一区二区三区在线观看国产 | 日韩精品一区在线观看 | 亚洲人在线 | 中文字幕在线第一页 | 成人毛片在线观看 | 国产一区二区三区在线 | 在线免费黄色 | 欧美精品综合在线 | 超碰精品在线观看 | 涩涩鲁亚洲精品一区二区 | 综合在线视频 | 天天弄 | 天天操天天干天天透 | 女同久久 | 可以免费观看的av |