Questions tagged [floating-point]

Approximate representation of numbers as a fixed number of digits multiplied by a logarithmic scale.

Filter by
Sorted by
Tagged with
1
vote
1answer
6k 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 ...
2
votes
1answer
821 views

What is 0.1 converted to 8bit IEEE754?

0.1 via $32\text{ bit}$ is rather easy: Sign: $0_2 = 0_{10}$ Exponent: $123_{10} = 01111011_2$ Mantissa: $5033165_{10} = 100110011001100110011001101_2$ Now, how do you calculate this, if you've ...
0
votes
1answer
353 views

Problem on Floating Point Representation

Consider the floating-point representation 31-24 : Exponent 23-0 : Mantissa The exponent is in 2's complement representation and mantissa is in the sign ...
0
votes
1answer
55 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 ...
2
votes
2answers
198 views

What's the algorithm for floating points equality test?

I've found that 0.1 + 0.2 == 0.3 is not true in Java (see this demo). So, I'm interested in how equality testing can be implemented for floats. Is there a ...
1
vote
0answers
191 views

Addition in IEEE 754

Hi I have this simple question. When adding a positive number with a negative number, both of same exponent. Imagine that after complementing the negative we have something like this: 1.111 + 0.001 .....
-2
votes
1answer
68 views

Product with floating point [closed]

I was studying the product with floating point and I saw this example. I made the translation, sorry if something is not grammatically correct. ![enter image description here][1]
1
vote
1answer
723 views

Machine epsilon vs least positive number

What is the difference between machine epsilon and least positive number in floating point representation? If I try to show the floating point number on a number line .Is the gap between exact 0 and ...
1
vote
1answer
66 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 ...
2
votes
2answers
217 views

Gap between numbers in fixed-point vs. floating point arithmetic

If $r$ is a machine-representable number and $f(r)$ is the next larger machine representable number, are the following true or false? In fixed-point arithmetic, the distance between $r$ and $f(r)$ is ...
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 ...
1
vote
1answer
80 views

Floating point operations; Exception, Flags, and Trap Handlers

I am reading over the article found here specifically §D.4.4 Exceptions, Flags and Trap Handlers and am confused by the table D-4 in that section. Specifically the arguments sent to the trap handler ...
0
votes
1answer
45 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
229 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
2answers
324 views

Problem in finding the floating point representation?

So, i was trying: $(-10.75)_{10}$ and to convert it into 32 bit binary floating point representation. i did this: According to IEEE standard: $(-1)^{-s} * 1.M * 2^{E-bias} $ ...
3
votes
1answer
123 views

When does the IEEE-754 64-bit float break as a counter

As a matter of curiosity I've been trying to determine at what point a 64-bit float no longer reflects the addition of 1 as expected; that is, at what point the digits as printed do not correspond to ...
5
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 ...
6
votes
2answers
310 views

What is the reason of inaccuracy of operations on float numbers?

I wonder why in JavaScript 0.1 + 0.2 // return 0.30000000000000004 4%0.1 // return 0.09999999999999978 http://jsbin.com/oHISAfU/1/edit (Example) In C the ...
0
votes
2answers
382 views

Implications of truncation of numbers when converted into binary

I have been posed with a question whereby a computer truncates numbers to x number of digits. Due to this, if this computer is trying to store a decimal number which has a binary equivalent greater ...
0
votes
1answer
606 views

In a 32-bit floating number with normalized mantissa and excess-64 exponent base 16, the number $16^{-65}$ denotes

In a 32-bit floating number with normalized mantissa and excess-64 exponent base 16, the number $16^{-65}$ denotes Floating point overflow. Negative floating point overflow. All 0's in the exponent ...
2
votes
1answer
1k views

Calculating Binet's formula for Fibonacci numbers with arbitrary precision

Binet's formula for the nth Fibonacci numbers is remarkable because the equation "converts" via a few arithmetic operations an irrational number $\phi$ into an integer sequence. However, using finite ...
13
votes
1answer
408 views

Floating point rounding

Can an IEEE-754 floating point number < 1 (i.e. generated with a random number generator which generates a number >= 0.0 and < 1.0) ever be multiplied by some integer (in floating point form) to ...