Giter Club home page Giter Club logo

Comments (3)

JessonYue avatar JessonYue commented on May 31, 2024

直播我会说,先Pass

from computer-basics.

empty56631 avatar empty56631 commented on May 31, 2024

三个字段分别是 S M E
S 决定这个数是正数还是负数(s=0为正数,s=1为负数)
M 代表二进制小数
E 代表阶码,作用是指明小数点在数据中的位置
比如 0 0110 0100 -> 0(位数 s) 0110(阶码 E) 0100 (小数 M)
通过公式计算就可以得出这个数等于 0.625
仅个人理解

from computer-basics.

JessonYue avatar JessonYue commented on May 31, 2024

首先记住:
一个浮点数 (Value) 的表示其实可以这样表示:
Value = sign * exponent * fraction。
也就是浮点数的实际值,等于符号位(sign bit)乘以指数偏移值(exponent bias)再乘以分数值(fraction)。分数值也称尾数值。

我举一个例子:
8.25用二进制形式表示为1000.01,表示成二进制的指数形式为1.00001 * 23,用科学计数法则表示为1.00001 * 2E3。
因为是正数,符号位即最高位为0;
指数位为3 + 127(移位存储) = 130,二进制形式是10000010;
尾数部分00001 = 0000100 00000000 00000000(23位)。
所以8.25在内存中储存为:0 10000010 00001000000000000000000

from computer-basics.

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.