DEV Community

Cover image for I Built an IEEE-754 Binary Calculator - Try My Open Source Binary Converter
Arma Sahar
Arma Sahar

Posted on

I Built an IEEE-754 Binary Calculator - Try My Open Source Binary Converter

I've open-sourced the code of how computers convert any fractional number to a binary number. Feel free to explore it, even contribute!

(GitHub Repo: IEEE 754 CLI Calculator)

Lately, we made the switch from C to JavaScript. While C gave us a solid foundation of programming, JavaScript feels like flying on autopilot with all its builtin methods.

The other day in one of our class we were given an assignment to build an IEEE 754 calculator from scratch.

But what’s IEEE 754?
It’s the standard format used by computers to represent and process floating-point (fractional) numbers, by breaking them into:
Sign: Is the number positive or negative?
Exponent: Powers of two, helping scale large or tiny values.
Mantissa: Holds the precision bits of the number.

📌 What this project does:
• Takes any decimal (fractional) input.
• Lets you choose between 32-bit and 64-bit precision.
• Breaks the number down into Sign, Exponent, and Mantissa.
• Shows you the final binary format of how a computers store it in memory.

It’s all built in a clean Command Line Interface using JavaScript. No frameworks. No extra fluff. Just pure logic and learning.!

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.