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
votes
1answer
199 views

NaN simple precision IEEE 754 [closed]

How many words exist in the format of the simple precision IEEE 754 standard to represent the NaN value?
7
votes
1answer
130 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: ...
0
votes
0answers
3k views

How do the Guard, sticky, and round bits work and affect floating point Representation?

I've got a test on this tomorrow, my instructor's lectures aren't up, and the notes are ambiguous... Anyhow, we've been covering floating point operations, specifically addition, and he mentioned ...
15
votes
4answers
2k views

Inequality caused by float inaccuracy

At least in Java, if I write this code: float a = 1000.0F; float b = 0.00004F; float c = a + b + b; float d = b + b + a; boolean e = c == d; the value of $e$ ...
1
vote
1answer
2k views

MSB and LSB in floating point number

What is MSB and LSB in significant of a floating point number? If I have a significant for example 0011010000 (half-precision) but 1. bit is implicit what is MSB: 0 or 1? In this case LSB is 0, ...
0
votes
0answers
89 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 ...
2
votes
2answers
754 views

Floating Point Systems - Rounding Error in Taylor series

I have a question about rounding error. I have created a function to approximate exp(x) by summing the terms of its taylor series until the sum stops changing. (That is, 1 + x + x^2/2! ...). This ...
0
votes
1answer
773 views

How to add two numbers in IEE754 half precision format?

i'm trying to understand how to add two numbers in IEE754 half precision format , i haven't found a good reference/tutorial on this , so i've tried to follow the 32 bit floating point addition ...
0
votes
0answers
42 views

Logarithms using digit recurrence, how many bits to store in a LUT?

In a known method for approximating logarithms the following decomposition is adopted (assuming $x \in [1,2)$): $$ log_2(x) = 1 + \sum_{j=1}^{+\infty} w_i log_2(1+2^{-j}) $$ Where all the ...
0
votes
0answers
332 views

Are floats abstract data types?

Source:https://en.wikipedia.org/wiki/Abstract_data_type Can we say that float data types (or all primitive data types or only integer) are abstract data types?
3
votes
2answers
1k views

How to prevent overflow and underflow in the Euclidean distance and Mahalanobis distance

I was working in my project when I was struck by the question of whether it would be necessary, or at least cautious, prevent overflow and underflow in the calculation of these two distances. I ...
2
votes
2answers
368 views

Find the duplicates in a list of floating point numbers

I receive a list of real numbers ( float ) between $0$ and $1$. The list has length $N+1$ and I need to find two numbers on the list which are $\le \frac{1}{N}$ ...
3
votes
1answer
43 views

Formal notations of equivalencence between floating point expressions

In an informal context, most programmers might call these two expressions "equal" and no one would be mislead: (a + b) + c a + (b + c) For floating point numbers,...
1
vote
1answer
103 views

What factors influence machine epsilon?

I was wondering what factors effect a machine's epsilon value. I was thinking about how modern computers can calculate expressions to higher accuracy then their predecessors, but what hardware and ...
-1
votes
1answer
524 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 ...
1
vote
1answer
369 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
545 views

Whether assigning of single precision IEEE754 float to double is reversible?

Using the IEEE754 standard, let's assign single precision variable s to double precision variable d and then assign d to single precision variable s'. Is this operation is reversible (lossless) for ...
2
votes
1answer
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?
1
vote
0answers
53 views

Dual Signed Kahan Summation

NOTE: This is for a project I'm working on for fun, NOT production code. So I'm working on a pet project that involves reading data in from a sensor and summing it up. The values are mostly ...
2
votes
1answer
128 views

Approximate a float using a minimal fraction

This sounds like it's probably a well-known problem, but I haven't been able to find references to it by searching. Given a floating point value $x$ and an error range $\varepsilon$, how can I ...
10
votes
1answer
581 views

Implementation of Naive Bayes

I am implementing a Naive Bayes algorithm for text categorization with Laplacian smoothing. The problem I am having is that the probability approaches zero because I am multiplying many small ...
1
vote
1answer
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 ...
0
votes
1answer
305 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 ...
3
votes
1answer
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....
0
votes
0answers
702 views

Calculating sums of floating point numbers by hand

how do you calculate the sum of 2.6125 * 10^1 and 4.150390625 * 10-1 by hand, assuming A and B are stored in the 16-bit half precision. i cant figure out how to do this by hand with out losing most of ...
2
votes
1answer
528 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 ...
3
votes
2answers
99 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 ...
3
votes
1answer
231 views

Is < binary relation a strict partial order on IEEE doubles?

To me it looks that it is: irreflexivity: NaN < NaN == false transitivity: if a < b and b < c then a < c (the antecedent is never true for NaNs) asymmetry: if a < b then not b < a (...
3
votes
0answers
87 views

Representing Computations on Transcendental Numbers

Consider the set of transcendental numbers that are not compressible to a finite base-2 representation. How can I compute multiples (more generally, any algebraic computation) of one of these numbers,...
1
vote
0answers
48 views

Understanding exponential computation by digit recurrence

I've met in a book the following algorithm that computes the exponential: Input: $t, n$ ($n$ is the number of steps) Output: $E_n$ $\begin{array}{l} \mbox{define $t_0 = 0$ ; $E_0 = 1$} \\ \mbox{...
3
votes
1answer
260 views

Is “flops” a reliable measure of deciding computational capacity?

Is "flops" a reliable measure of deciding computational capacity? If we do matrix multiplication and matrix addition of the same size of matrix, do the flops remain the same? Referring to question ...
0
votes
2answers
316 views

Why are transcendental functions of large numbers inaccurate on computers?

For instance, why is it hard to accurately compute sin(1e99)? I suspect it has something to do with rounding error.
2
votes
1answer
483 views

Will floating point code return the same arithmetical results on two different computers?

Say I am using boost or the built-in float or double mathematical libraries of my C++ compiler. I distribute the program. Will the execution of my C++ program on different machines given different ...
2
votes
0answers
59 views

Normalised Floating Point System

I have a floating point number system and I have a number for which I need to calculate the exact relative error after rounding. The number is clearly an overflow. Does anyone know what I should do? ...
2
votes
1answer
6k 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 ...
1
vote
1answer
141 views

floating point rounding (1/x)*x

I'm trying to figure out what the smallest positive integer x such that the floating point expression round(round(1/x)*x) is not equal to 1 in single precision. I have that the answer is 41, but when ...
6
votes
2answers
92 views

Program transformations for numeric stability

There's tons of research on program transformations for optimization. Is there any research on transformations that improve numeric stability? Examples of such transformations might include: ...
2
votes
2answers
277 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 ...
2
votes
2answers
2k views

Controlling overflow and loss of precision during floating point multiplication

I have a large number of floating point numbers (~10,000 numbers) , each having 6 digits after decimal. Now, the multiplication of all these numbers would yield about 60,000 digits. But the double ...
1
vote
0answers
48 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
335 views

Why doesn't the binary fraction representation match the decimal fraction representation?

The Problem: What value does the hexadecimal number x55544552 represent in data type IEEE floating point? My Work:     I first wrote out that hexadecimal number in binary and got ...
3
votes
2answers
3k 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
46 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
5k 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
755 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
329 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
54 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
195 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
188 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]