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
4
votes
2answers
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 ...
2
votes
2answers
294 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 ...
1
vote
1answer
714 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 ...
1
vote
2answers
81 views

Why is a negative number a pseudo-positive number in ones' complement?

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'...
5
votes
2answers
1k views

How do calculators convert from decimal to fraction?

Sorry if this question is either obvious or ignorant. I am a high school student with only the computer science knowledge I have taught myself. Calculators have a function that can convert numbers ...
1
vote
0answers
49 views

Why have only 15 bits been apportioned for the exponent in the 128-bit quad-precision datatype?

I look forward to the day we can start using quad-precision numbers, but was disappointed to see that in the specification, only 15 bits out of a whopping 128 were assigned to the exponent as shown by ...
1
vote
1answer
431 views

Convert 24(decimal) to modified IEEE 754 floating point format?

Here's what I have as the tweaked format I'm to use: S EEE MMMM (excess 8 format) s = sign bit, E = exponent bits, M = mantissa/fraction bits Otherwise, it follows the IEEE 754 in principle. The ...
3
votes
3answers
4k views

What does normalizing with hidden bit really mean?

I have a question related to representing numbers in base 2 with floating point. For example, if I have such a number $$0.000011 \cdot 2^3$$ then is its normalized form this? $$1.1\cdot 2^{-2}$$ ...
1
vote
1answer
51 views

Normalising fractional numbers

For example $-\tfrac9{16}$. $$\tfrac{9}{16} = \tfrac{1}{16}+\tfrac12 = 0.1001\,,$$ which when normalised becomes $0.1001\times 2^0$. Can its mantissa be $0.0001001$ in 8 bits? If so, as $-\tfrac9{16}...
1
vote
1answer
7k views

Interpretation of '1/3' in IEEE floating point representation

For a rational number 1/3 below is the floating point representation(64 bit) of decimal expansion 0.3333333.... As per the above bit structure, I would like to ...
0
votes
1answer
59 views

Rounding errors when converting floats to integers

Is it possible to have a rounding error when you convert a floating point number which can only be in increments of 0.01 to an integer by multiplying by 100 first? I would think that the lack of ...
1
vote
1answer
94 views

Positional number representation

There is a definition of integer representation: A positional representation for integers that uses the binary digits 0 and 1, in which the values represented by successive bits are additive, ...
2
votes
1answer
369 views

Maximum single-precision floating-point format number

According to this wikipedia article the maximum single precision is 7f7fffff. Can some explain me why it is (7f7fffff)16 and not (7fffffff)16? (7f7fffff)16 = (0111 1111 0111 1111 1111 1111 1111 1111)...
0
votes
1answer
286 views

Confusion in “mask bits”

This is the question: By definition of the IEEE754 standard, 32-bit floating point numbers are represented as follows: S (1 bit) E (8 bits) M (23 bits) S: Sign bit E: Exponent M: ...
8
votes
5answers
4k views

Using base 80 for compressing files

I want to compress file size through making my own numbering system which is 80-based number, I do really want to know whether this even possible ? I learnt that Hexadecimal uses symbols like A, B, C, ...
1
vote
1answer
72 views

Why is the precision of floating point numbers worse for smaller numbers?

Why is the machine error/epsilon higher between a pair of two lower numbers than a pair of two high numbers? For example, between the two smallest numbers possible in 5 bit mantissa and the two ...
10
votes
9answers
3k views

Represent a real number without loss of precision

Current floating point (ANSI C float, double) allow to represent an approximation of a real number. Is there any way to represent real numbers without errors? Here's an idea I had, which is anything ...
0
votes
1answer
49 views

floating point normalised value of -1

I have, lets say, 8 bits mantissa and 4 bit exponent. Then, -1=1111 1111 there are no 0s so how can I normalise -1 in 2's complement form?
3
votes
1answer
249 views

Can we improve the precision of IEEE floats by dropping leading zeros in the mantissa?

It seems like it would be possible to add more precision to the IEEE 32-bit mantissa system if the leading zeroes were also dropped, just like the leading 1 is dropped due to it being implicitly known....
0
votes
1answer
1k views

MIPS: sign extend in I-Type commands

My lecturer told me that when I use an arithmetic I-Type command (ADDI,SUBI etc.) , the IMM field gets sign extended, and when I use a logic I-Type command (ORI,ANDI etc.) , the IMM field is just bits....
-1
votes
1answer
39 views

Why do I not get the correct smallest possible value in 2's complement?

When using 2's complement with 4 bits, the largest positive int I can represent is 0111. The smallest negative one is 1000. The smallest int should intuitively be the negative of 0111 - 1 = 0110 ...
3
votes
2answers
114 views

Floating point format: why must `1−emax ≤ q+p−1 ≤ emax`?

From the Wikipedia page on the IEEE Standard for Floating-Point Arithmetic, The possible finite values that can be represented in a format are determined by the base (b), the number of digits in ...
2
votes
2answers
955 views

Implicit Leading 1 in Binary Floating Point

Is the convention of dropping the leading 1 when storing the significand a given in all binary floating point representations or not necessarily?
2
votes
3answers
617 views

Can a unnormalized floating point number be recognized also when exponent is not zero?

From Tanebaum's Structed Computer Organization. Exercise 4 of Appendix B The following binary floating-point number consist of a sign bit, an excess $64$, radix $2$ exponent, and a $16$-bit ...
6
votes
1answer
2k views

Confused by Floating Point Spacing

I'm currently taking a numerical analysis class in college and we're covering floating point systems. For the most part, I have a good grasp on it. However, something I can't seem to visualize, and ...
0
votes
1answer
183 views

Show that only a few multiples of .01 decimal are powers of 2

I am asking this to advance the argument that BigDecimal is better than float or double for representing exact amounts of currency. Can someone refer me to a proof that between any two integers ...
37
votes
6answers
56k 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 ...
20
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 ...

1
2