A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

# Questions tagged [number-formats]

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

73 questions
Filter by
Sorted by
Tagged with
21 views

### Little Endian and Decimal numbers

I understand that, for some hex string like 0xF0B0D0, the reverse byte order is 0xD0B0F0 since two hexademical digits represent ...
36 views

### calculating the index in a FOR loop

I am coding in Matlab: ...
69 views

### How does a computer compute negative(-) and positive(+) Infinity?

If we divide (1.0/0.0) we will get +Infinity and if we divide (-1.0/0.0) we will get -Infinity. How does a computer calculate this value internally?
92 views

### Is decimal number 8 represented as 3 bits or 4 bits in computer?

I was told by my professor that "It takes c * ln(n) bits to store a number n, where ln() is base 2 and c is a constant." Thus, to store a number 8, we need ln(8) = 3 bits(I think const c can be ...
102 views

### How much can we trust mathematical software when working with large numbers, and how much memory it needs to work with these numbers?

For example, I want to evaluate the expression: $3^{3^{{3}^{3}}}$ so I used wolframalpha.com (it's free, and I don't own any software), which returned the scientific notation of the number above, ...
40 views

### Space-efficient representation of potentially very large arbitrary-precision rationals?

I'd like to know if there are good techniques for faithfully and (reasonably) representing rational numbers with forms similar to: 2/3 1/10 4 * 10 ^ 1,000,000,000,000 I know arbitrary precision ...
28 views

### What is the equivalent of the integers symbol Z for n bit only integers?

We refer to the set of all integers as $\mathbb{Z}$. Now suppose we have a set of integers that can be held within a computer variable of $n$ bits width. Clearly they can only be of $2^{n}$ range, ...
31 views

### Converting a decimal to IEEE754 32-bit binary number

Convert 0.625 to IEEE754 32-bit binary number. 0.625 x 2 = 1.250 0.250 x 2 = 0.500 0.500 x 2 = 1.000 So, ...
83 views

### Why isn't it necessary to store an integer part of significant in IEEE754 floating point notation?

We see that there is a sign, exponent, and mantissa part for the notation. But, there is no location for the significant bit. Why isn't it necessary to store an integer part of significant in IEEE754 ...
192 views

### Why does little endian apply to numbers and not to text strings?

The Portable Executable file format is the format that Windows EXE files use. It is a binary format. Numbers are in little endian form. Thus, the following hex represents the decimal number 256, not ...
203 views

In class, I've heard hexadecimal representation for IEEE754 mentioned and described in 32bit length as a format that consists of one bit for sign, normalized 6-digit fraction (with an implied leading ...
1k views

### Overflow rule in two's complement arithmetic

In the book by William Stallings the overflow rule overflow rule for 2's complement addition is stated as follows: Overflow rule: If two numbers are added, and they are both positive or both ...
64 views

### Why can we write almost any nonzero 2-adic integer in the same form?

The title was difficult to formulate (I am open to suggestions). Two things bug me about this: "is almost any" is imprecise, which goes against Volume 1's statement on definiteness. When he writes, "...
35 views

### Two's complement max with a different base

Working with fixed size integer representations, use a number system with b-complement notation, base b = 9 and n = 4 digits. What is the smallest number that can be represented in this number system?...
56 views

### Why are floats converted from different integers sometimes equal?

I'm trying to understand the following algorithm: ...
40 views

### How many unique counting functions there are for strings of N bits?

Let a counting function inc for inputs of N bits be defined as: ...
2k views

### Confusion in 2's complement of 00000000

I'm solving the end of the chapter problems of Morris Mano's Digital Design (4th Edition, if that's relevant). In one of the problems, it is asked to simply find the 1's and 2's complement of 00000000....
33 views

### What is the range of possible IP addresses when expressed as decimal and hexadecimal?

I know that there are $2^{32}$ different combinations of IPv4 addresses possible , if expressed in binary. In decimal notation, they range from $0.0.0.0$ to $255.255.255.255$. So are there $256^{4}$ ...
97 views

### Imaginary numbers and negative zero

I've been studying the low-level hardware implementations of floating point numbers and doing an exercise to design a custom floating point implementation. I know that being able to represent ...
126 views

### Float multiplication

While doing the multiplication 1.4*0.8 in a python program, I got the result as 1.1199999999999999. Why didn't I get ...
46 views

### IEEE largest number for any machine representation

If we consider a machine that uses 64 bits to represent a number. If 1 bit is used for sign, "x" bits to represent mantissa and (63-x) to store the (biased) exponent in a manner similar to the IEEE ...
218 views

### n-bit 2's Complement Conversion

I'm learning 2's complement conversion for positional number systems. For the most part I have only seen 2's complement for represented in 8-bits. I had a discussion with a friend who explained that ...
231 views

### $2^1 + 2^2 + \cdots + 2^8$ in binary

Maybe these are silly question. I know almost nothing about computer science, so please let me know in the comment section if I should edit anything or delete it. Let's say I have a function that ...
154 views

### -4 as floating point

How would one represent the number -4 as an 8-bit normalised, 2's complement, floating point, with 4 bits dedicated to the exponent? As a normal 4-bit 2's complement number, it would be represented ...
62 views

### Smallest number with in a larger number with a certain length

I have a number with $n$ digits. I want to keep only $m$ digits out of it. What is the smallest possible $m$ digit number which can be generated from the larger number so that order of digits is ...
948 views

### How to convert a decimal number to ASCII representation [closed]

The question that was in my lecture notes said "Encode the decimal number 2370 in ASCII. " and the answer given there is ...
91 views

### How to determine the range of a number represented in IEEE-754 format?

Given a format: say 12-bit floating point with sign bit, 5 - bit biased exponent and 6- bit significant with implied bit, how do i go about determining the range of ...
218 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: ...
141 views

### Why complement of most negative number in octal does not turn out to be itself

I know the range of the $n$ digit numbers in $r$'s complement system is given as $r^{n-1}-1$ to 0 to $-r^{n-1}$. So for 3 bit 2's complement, its: $(2^2-1)$ to $0$ to $-(2^2)$ that is $3$ ...
2k views

### Subtraction using 15s complement

I know 15s complement subtraction may not be much taught/popular one, but I just want to give it a try. Just trying to clear my basic digital logic/number systems concepts. Here is what I am doing: ...
112 views

### Why aren't numbers stored this way?

I read that the further you get from 0, the less precision, due the way they are stored. So why aren't numbers stored like this: $32$ bits for representing a value between $-2^{31}$ and $2^{31}-1$ ...
751 views

### Is there any practical trick to mentally count in Gray code?

When I was fairly young, I taught myself to count in binary. I thought it would be a fun party trick to impress people. I soon found out that it was not. Over the years I've come to appreciate Gray ...
3k views

### Why do we need to convert binary numbers into hexadecimal, octal and decimal?

Computer reads binary. Now my question is, what is the use of hexadecimal, octal and decimal? Do Computers understand or can read hexadecimal, octal and decimal? This question remains a mystery for me....
553 views

### Convert between IEEE 754-2008 decimal64 and IEEE double precision floating point number

I need to know the algorithm for converting between IEEE 754-2008 decimal64 and IEEE 754-1985 double precision floating point number. I have been working on this for the past 2 days and I match the ...
687 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 ...
1k views

### How to work out if an IEEE 754 floating point number is normalized?

How do I tell whether a particular IEEE 754 floating point number is a normalized floating point number? Is there some way to recognize an IEEE 754 normalized floating point number?
140 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: ...
45 views

### Why do floating point additions sometimes produce equal results? [duplicate]

I have tried two sentences on my computer : 2 + 10^(-18) == 2 2^(-55) + 2^(-57) == 2^(-55) My computer gives TRUE and FALSE respectively. Why does the computer ...
364 views

### What happens if we add denormalized number and normalized number?

Denormalized numbers can represent numbers smaller than 2^(-1022) whereas normalized number cannot. So I'm curious what happens if we add denormalized number and normalized number. Actually, I have ...
1k views

### Smallest number close to 0 in IEEE754 (64bits)?

I thought the smallest number close to 0 would be : 0 00000000001 (exponent) 0000000000000000000000000000000000000000000000000000 (significand) But this site (http://binaryconvert.com/result_double....
13k views

### Algorithm to convert decimal number to binary

I am reading this material to understand the basics of number system. I am stuck at a point in that material where it writes the algorithm to convert a decimal number to binary number. The heading of ...
572 views

### Distribution of IEEE 754 single precision floating point over number line

"What is the maximum and minimum difference between two successive real numbers representable in IEEE 754 Single Precision and Double Precision Floating Point Representations respectively?" In ...
873 views

### What is the 1's and 2's complement of 0.01101?

What is the 1's and 2's complement of 0.01101? I'm unable to find any details on this from google. Basically how do we represent the floating points in 1's and 2's complement forms? Even wikipedia ...
7k views

### Hex Bit Pattern to IEEE 754 standard Floating Point Number

The question asks for the decimal number that 0x0C000000 represents if it is a floating number. I'm not too sure on how to approach this, but here's my thought process: 0x0C000000 = 0000 1100 0000 ...
3k views

### Floating point normalised numbers in binary

Many text books state that for a binary floating point representation in a computer byte, that if the mantissa is normalised, then a positive number must start with 01 from the left or a negative ...
108 views

### “Compressing” rationals given error bounds

I'm working on implementing some exact real arithmetic operations for fun. I've got the rough outline of how I want to do things as well and have figured out how to write most of the important ...
287 views

### Why is there more frequent overflow in normalised Floating Point

I read that overflow is more frequent when we work with normalised mantissas. Why is this? Is it because when we adopt a normalised representation, our range is smaller than in a unnormalised ...
666 views

### Efficient algorithm for conversion of hexadecimal fraction to decimal fraction

Let's say I have some very long hex fraction like this: 0.3F30A21306AEFCBADE3230A593EFAEB395A39E What are some algorithms with an acceptable complexity to ...
I'm studying ones' complement representation and I read in a book that a negative number in ones' complement is a pseudo-positive of value $R^n - 1 - |x|$. However there is no demostration and I can'...