Giter Site home page Giter Site logo

Comments (5)

ruanyf avatar ruanyf commented on May 6, 2024 3

我把原文又改了一下。

“事实上,JavaScript对指数部分的两个极端值(11111111111和00000000000)做了定义,11111111111的一个含义就是Infinity,00000000000的一个含义就是0。”

On Sat, Feb 22, 2014 at 9:27 PM, Humphry [email protected] wrote:

11111111111还有NaN的情形


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-35802494
.

from jstutorial.

ruanyf avatar ruanyf commented on May 6, 2024

谢谢指出,我确实写错了。

已经改过来了,请看看现在这样是否可以:

"另一方面,64位浮点数的指数部分的长度是11个二进制位,意味着指数部分的最大值是2047(2的11次方减1)。也就是说,64位浮点数的指数部分的值最大为2047,分出一半表示负数,则JavaScript能够表示的数值范围为21024到2-1023,超出这个范围的数无法表示。"

-- 《数值》

另外,我把你的文章加入了“参考链接”。

from jstutorial.

alvarto avatar alvarto commented on May 6, 2024

特殊值0和2047被保留的缘故,(-1023,1024)是开区间,指数的表示范围2^-1022-2^1023。
谢引用:)

from jstutorial.

ruanyf avatar ruanyf commented on May 6, 2024

谢谢提醒,现在将原文改为下面这样:

如果指数部分等于或超过最大正值1024,JavaScript会返回Infinity,这称为“正向溢出”;如果等于或超过最小负值-1023(即非常接近0),JavaScript会直接把这个数转为0,这称为“负向溢出”。事实上,JavaScript将指数部分的两个极端值(11111111111和00000000000),就分别定义为Infinity和0。

On Fri, Feb 21, 2014 at 12:16 PM, Humphry [email protected] wrote:

特殊值0和2047被保留的缘故,(-1023,1024)是开区间,指数的表示范围2^-1022-2^1023。
谢引用:)


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-35697845
.

from jstutorial.

alvarto avatar alvarto commented on May 6, 2024

11111111111还有NaN的情形,00000000000还有非规格化值的情形。很难一下子概括全

from jstutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.