Questions tagged [number-formats]

For questions about method for storing and manipulating numbers on computer systems, such as floating point or binary representations.

Filter by
Sorted by
Tagged with
39
votes
6answers
58k views

The math behind converting from any base to any base without going through base 10?

I've been looking into the math behind converting from any base to any base. This is more about confirming my results than anything. I found what seems to be my answer on mathforum.org but I'm still ...
1
vote
1answer
817 views

Convert integer of mixed radix to standard positional numeral system and vice versa

I have multiple numbers (e.g. [1, 4, 2]) where each number can be one of a specified range of numbers (e.g. [0-1, 0-5, 0-3]). I ...
23
votes
7answers
9k views

Why floating point representation uses a sign bit instead of 2's complement to indicate negative numbers

Consider a fixed point representation which can be regarded as a degenerate case of a floating number. It is entirely possible to use 2's complement for negative numbers. But why is a sign bit ...
7
votes
1answer
159 views

Difference between ways to compare floating-point numbers

There seems to be many approaches to judge whether two floating-point numbers are identical. Here are some examples I've found: ...
-1
votes
2answers
249 views

How does the CPU form the binary representation for a number?

More generally, how those translating softwares, for example, an assembler, like nasm, know how to transform in machine code the number "10", from this command: ...