Code Monkey home page Code Monkey logo

floating-point-ieee754's Introduction

The Floating Point System and the IEEE 754

IEEE 754 is a standard for normalizing so that the computer can represent real numbers from base-2 (binary). The binary system is used because it has a higher performance in dealing with calculations.

Principles and Fundamentals

✅ - This repository is for the authors own teaching purposes and is definitely not a blog post.

✅ - There is no lack of references on the Internet for understanding the problem.

✅ - Such that the goal is to experience these events as representation errors, precision, rounding, comparison and propagation. So that it is possible to understand in practice and implement alternatives.

✅ - The language chosen for the practical exercise was Javascript. But, the phenomenon happens in most programming languages and development environments.

The Numbers Dilemma 🤔♾

Given a range of values, we need to deal with the trade-off between representing as many values as possible and how to represent them accurately.

SinglePrecision and DoublePrecision From Wiki

  • The Double Precision system can store more values and with higher accuracy, since it has a higher capacity for significant digits (52 values) versus (23 vaulues) in single precision.

  • 5.25 in base-2

> +(5.25).toString(2)
output: 101.01

Representation Errors

  • Just as we cannot represent the fractional value (1/3) in the decimal base such that the value is (0.333333333...). In the binary system, it is no different. In some cases it is impossible to represent a number with 100% accuracy.

  • There is no such thing as infinite precision, since computer memory is finite.

  • One technique for representing fractional numbers in binary is to work with negative powers of an integer. In this way, it is possible to represent fractional quantities of an integer.

  • The use of binary numbers increases the performance of the computer when doing calculations. If there is a need for coverage because of the sensitivity of exact values in a '$FOO' application, this challenge is in the hands of the developer.

  • Since Javascript does not have a native decimal type like in Java (BigDecimal), a widely used alternative is to install libraries that can use a decimal of limited precision.

References and Inspirations, so far: ⏳

Feedback ⭐🚀

Learning in Public Method in the quest for better results. 📈

🔓 The fatest way to learn to the next level.

💌 If you have any feedback, please reach out to us at [email protected]

floating-point-ieee754's People

Contributors

barbosacode-lab 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.