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

為什么浮點(diǎn)數(shù)有符號(hào)零?

Why do floating-point numbers have signed zeros?(為什么浮點(diǎn)數(shù)有符號(hào)零?)
本文介紹了為什么浮點(diǎn)數(shù)有符號(hào)零?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

為什么雙打有 -0+0?有什么背景和意義?

解決方案

-0 (通常)被視為 0 *******.當(dāng) negative 浮點(diǎn)數(shù)非常接近于零以至于它可以被認(rèn)為是 0 時(shí),它可能會(huì)導(dǎo)致(要清楚,我指的是 )

用數(shù)學(xué)術(shù)語:

這說明了 0-0 在計(jì)算意義上的一個(gè)顯著區(qū)別.

<小時(shí)>

這里有一些相關(guān)資源,其中一些已經(jīng)提出.為了完整起見,我將它們包括在內(nèi):

  • 關(guān)于簽名零的維基百科文章
  • "每個(gè)計(jì)算機(jī)科學(xué)家都應(yīng)該知道的浮點(diǎn)運(yùn)算知識(shí)"(參見有符號(hào)零部分)
  • (PDF) "Much Ado About Nothing's Sign Bit" - 一篇有趣的論文由 W. Kahan 撰寫.

Why do doubles have -0 as well as +0? What is the background and significance?

解決方案

-0 is (generally) treated as 0 *******. It can result when a negative floating-point number is so close to zero that it can be considered 0 (to be clear, I'm referring to arithmetic underflow, and the results of the following computations are interpreted as being exactly ±0, not just really small numbers). e.g.

System.out.println(-1 / Float.POSITIVE_INFINITY);

-0.0

If we consider the same case with a positive number, we will receive our good old 0:

System.out.println(1 / Float.POSITIVE_INFINITY);

0.0


******* Here's a case where using -0.0 results in something different than when using 0.0:

System.out.println(1 / 0.0);
System.out.println(1 / -0.0);

Infinity
-Infinity

This makes sense if we consider the function 1 / x. As x approaches 0 from the +-side, we should get positive infinity, but as it approaches from the --side, we should get negative infinity. The graph of the function should make this clear:

(source)

In math-terms:

This illustrates one significant difference between 0 and -0 in the computational sense.


Here are some relevant resources, some of which have been brought up already. I've included them for the sake of completeness:

  • Wikipedia article on signed zero
  • "What Every Computer Scientist Should Know About Floating-Point Arithmetic" (See Signed Zero section)
  • (PDF) "Much Ado About Nothing's Sign Bit" - an interesting paper by W. Kahan.

這篇關(guān)于為什么浮點(diǎn)數(shù)有符號(hào)零?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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(使用線程逐塊處理文件)
主站蜘蛛池模板: 日日操操操 | 三级成人在线 | 日韩一二三区视频 | 欧美aaaaaaaa| 精品一二区 | 综合色播 | 久久精品久久精品久久精品 | 美女在线观看国产 | 性国产xxxx乳高跟 | 激情国产在线 | 91麻豆精品一区二区三区 | 亚洲日日 | 欧美日本韩国一区二区三区 | 国产视频中文字幕 | 欧美日韩成人影院 | 91在线视频网址 | 亚洲 中文 欧美 日韩 在线观看 | 黄色精品| 成人免费在线视频 | 羞羞视频免费在线观看 | 成人av网站在线观看 | 亚洲精品免费在线观看 | 免费观看的av毛片的网站 | 日韩高清成人 | 久久精品成人一区 | 国产精品一区二区三区在线 | 在线免费观看成人 | 国产视频中文字幕 | 亚洲综合在线一区 | 国产精品电影网 | 欧美在线看片 | 日韩精品极品视频在线观看免费 | 欧美色性 | 国产成人a亚洲精品 | 国产成人啪免费观看软件 | 最近最新中文字幕 | 午夜激情在线视频 | 久久精品影视 | 91偷拍精品一区二区三区 | 亚洲精品一区二区三区蜜桃久 | 一区免费看 |