Code Monkey home page Code Monkey logo

32-bits-float's Introduction

#32 Bits Representation of Float Number

Sample output:

Enter a float: 34.789
Your float was read as: 34.789001
Your float in 32 bits: 01000010000010110010011111110000
Sign: 0
Exponent: 10000100
Fraction: 00010110010011111110000

Creating the fraction:
fraction = 1.000000 (the implicit 1)
fraction = 1.000000, after skipping 0.500000
fraction = 1.000000, after skipping 0.250000
fraction = 1.000000, after skipping 0.125000
fraction = 1.062500, after adding 0.062500
fraction = 1.062500, after skipping 0.031250
fraction = 1.078125, after adding 0.015625
fraction = 1.085938, after adding 0.007812
fraction = 1.085938, after skipping 0.003906
fraction = 1.085938, after skipping 0.001953
fraction = 1.086914, after adding 0.000977
fraction = 1.086914, after skipping 0.000488
fraction = 1.086914, after skipping 0.000244
fraction = 1.087036, after adding 0.000122
fraction = 1.087097, after adding 0.000061
fraction = 1.087128, after adding 0.000031
fraction = 1.087143, after adding 0.000015
fraction = 1.087151, after adding 0.000008
fraction = 1.087154, after adding 0.000004
fraction = 1.087156, after adding 0.000002
fraction = 1.087156, after skipping 0.000001
fraction = 1.087156, after skipping 0.000000
fraction = 1.087156, after skipping 0.000000
fraction = 1.087156, after skipping 0.000000

Applying the exponent:
unbiased exponent = 5
times 2 = 2.174313
times 2 = 4.348625
times 2 = 8.697250
times 2 = 17.394501
times 2 = 34.789001

Final Answer: 34.789001

32-bits-float's People

Contributors

teraliv avatar

Watchers

 avatar

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.