久久久久久久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?這意味著什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

為什么原始浮點(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)我打印它時,它會打印 -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 以及何時應(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ù)中沒有 1 位,由符號確定,稱為正或 負(fù)零.它實(shí)際上表示在零和相同符號的最小可表示非零數(shù)之間的范圍內(nèi)的數(shù)字四舍五入到零,這就是它有符號的原因,以及它的倒數(shù) +Inf 或 -Inf 也有符號.

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.

您可以通過添加 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 以致無法正常表示時,會產(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?這意味著什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 久久综合狠狠综合久久 | 国产午夜精品一区二区三区四区 | 精品久久久网站 | 欧美区日韩区 | 国产精品18久久久久久久 | 在线视频亚洲 | 成人欧美一区二区三区黑人孕妇 | 在线看免费的a | 欧美日本韩国一区二区三区 | 先锋资源亚洲 | 成人午夜免费福利视频 | 精品国产一区二区三区日日嗨 | 日韩中文字幕免费在线 | 欧美一级在线免费观看 | 国产美女网站 | 在线观看亚洲专区 | 欧美一级淫片免费视频黄 | 在线观看电影av | 午夜小影院 | 精品一区二区三区91 | 中文在线播放 | 91久久| 国产一区二区三区四区在线观看 | 最新av在线网址 | 亚洲精品一区二区三区在线 | 在线观看精品视频网站 | 精品国产乱码久久久久久果冻传媒 | 国产午夜精品理论片a大结局 | 欧美国产精品一区二区三区 | 欧美一级片在线看 | 天天久 | 奇米影视在线 | 日本高清视频在线播放 | 精品久久久久久久久久久 | 久久久久久高清 | 亚洲国产精品久久久久久 | 国产精品一区二区免费 | 亚洲成人精品国产 | 天啪| 精品视频在线观看 | 精国产品一区二区三区四季综 |