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

Understanding truncation and rounding error in IEEE floating point system?

I'm trying to understand the theory behind finding the optimal $h$ value for differentiation in this definition: $$ \frac{f(x+h) - f(x)}{h}$$ as $h$ tends to 0. Here is my understanding: ...
1
vote
1answer
452 views

How to Add IEEE 754 Floating Point Numbers

I'm trying to add two 16 bit numbers that use a similar format as IEEE 754. The format is in the image below: I can't figure out how to add together two numbers for the life of me. Specifically, ...
3
votes
1answer
53 views

Why do I get really different results with my benchmarking code I made?

I'm doing research work for my last year in high school. My work is about processors and for the experimental part i've coded an app that can mesure how many Floating Point Operation can a processor ...
4
votes
1answer
88 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 ...
1
vote
2answers
300 views

Is IEEE 754 float arithmetic associative, commutative, distributive, etc? Why?

Does the associative/commutative/distributive/etc property hold for arithmetic performed with IEEE 754 floats? Obviously the answer is no to most of those questions, but do any of the properties of ...
4
votes
2answers
59 views

Union of fixed and floating point types

Say I have two real number types. They may be floating or fixed point. How can I construct a new type whose values are at least the union of the two with the minimal number of bits? There are 3 cases ...
1
vote
4answers
110 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 ...
1
vote
2answers
51 views

Float type variable uncertainty

I developed an image processing software and I need to do a numerical analysis of it, considering the error propagation associated to its operations and the uncertainty of float type variables caused ...
0
votes
0answers
57 views

Inverting an IEEE 754 double

While preparing for an exam I've come across this problem: Let $x$ be an IEEE 754 double precision number. Show that $$ \texttt{fl}(x * \texttt{fl}(1/x)) $$ has only 2 possible results ...
0
votes
1answer
1k views

What is exponent of denormalized real in IEEE 754 floating point format?

I was reading this link. Here I noticed that, in table titles "Float Values (b = bias)", in exponent column, entry for denormalized reals is $00..00$, but in value column, the entry is $-b+1$. Why is ...
1
vote
1answer
151 views

Genetic Algorithm Getting Stuck on Certain Values

I'm attempting to teach myself something about genetic algorithms. I found a simple tutorial on it here, and it made enough sense that I was able implement the suggested example of generating a string ...
1
vote
1answer
44 views

How do proof assistants nowadays avoid floatpoint error?

I heard that Coq is using "Dedekind cut", but how's that related to floatpoint errors? Can we just use something like ...
1
vote
1answer
23 views

Exact Value of Denormalised number related to floating point numbers

I faced with the following issue: if the value of a floating point format number is in the range of underflow, it must be 0 or a denormal number.If the value is not 0 than what is the exact value of ...
3
votes
1answer
362 views

Why do floating point values have infinity?

Why do floating point values have infinity instead of just a higher exponent?
1
vote
1answer
39 views

Converting a 32-bit bit pattern into floating point number

In The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D. i have read something like that, Single precision or 32-bit floating point forms the floating point number,...
1
vote
1answer
1k views

How does conversion from fixed-point to floating-point happen?

I came across to the code that convert 32-bit signed fixed-point number (16.16) to a float and it looks like (pseudocode) floating = fixed / 65536.0 Could you ...
1
vote
1answer
56 views

Shortest decimal expansion within binary interval

Consider an interval $[x-2^n,x+2^n]$ defined by a binary float $x$ and a power of two $2^n$ typically much smaller than $x$. I would like to know whether an efficient algorithm exists to determine the ...
2
votes
0answers
28 views

Heuristic Consistency with float multiplications

I'm running A* search with a theoretically consistent heuristic. I'm doing a lot of float multiplications, and I'm not sure how best to ensure that my heuristic remains consistent down to the last ...
1
vote
1answer
145 views

how to convert any fraction to decimal

So for a project I am working on. I need to take a string representation of a floating point number, lets say "1.5" and do arithmetic on it with another floating point number. The catch is I cannot ...
0
votes
2answers
503 views

Convert a decimal floating-point number into a binary floating-point number

Let's say I have a decimal floating-point number, i.e. a mantissa and precision (negative exponent), both represented as integers. How do I convert this into a binary floating point number (of the ...
6
votes
1answer
417 views

Simple algorithm for IEEE-754 division on 8-bit CPU?

IEEE Std 754-2008 is the modern definition of Floating-Point Arithmetic. It requires that division (among other operations) performs as if it first produced an intermediate result correct to ...
1
vote
1answer
54 views

Compress 32 bit integer into a normalized float

and sorry if this is a duplicate of some sort, my poor technical vocabulary doesn't get me very far with google. I am trying to implement some well-known PRNG algorithms. For the time, the algorithm ...
1
vote
1answer
110 views

What are some of the practical applications of functions that extract the exponent and mantissa of a floating point number?

I'm talking about functions such as Python's math.frexp() : math.frexp(x) Return the mantissa and exponent of x as the pair (m, e). m is a float and e is an integer such that x == m * 2**e ...
1
vote
1answer
405 views

Neural Networks: Simulate the working of Dynamic Fixed Point representation of the weights on hardware

I am looking to implement a neural network on hardware using Verilog. I have completed and tested with floating point representation and a 20 bit fixed point representation. I want to further reduce ...
2
votes
0answers
32 views

numeric stability of map reduce operations

I am building a small library for computing information retrieval metrics for classifiers (precision, recall, f1, accuracy, whatever). Typically each metric is built by calculating a single value for ...
0
votes
0answers
31 views

When do you know whether an exponent represents a movement of the decimal point to the left?

I'm learning about floating point numbers and I don't quite understand when one should interpret an exponent as moving the decimal point to the left. By book shows an example of converting -10.5 ...
2
votes
2answers
1k views

How to estimate floating-point precision of function?

Let's say I have a function that consists solely of floating-point operations where the last operation rounds the computed value to a predefined number of digits. And I feed this function with a range ...
1
vote
2answers
1k views

What are the reasons for and against using normalized floating point?

Floating point number formats can be normalized or not, meaning that ‘normal’ floating point numbers have an implicit (hidden) leading bit 1 in the significand. For example, the binary IEEE 754 ...
2
votes
1answer
211 views

Are IEEE floating point numbers intervals or point values?

The context is IEEE 754-2008 floating point number systems. The systems defined by the standard comprise, as far as I understand it, a bit-level representation and a set of guarantees on the precision ...
3
votes
1answer
228 views

Why a separate ALU is needed, since any integer can be represented as floating point numbers?

Most of the operations in computer are using floating point arithmetic.Put it simply why a Floating Point Unit alone is not sufficient? Can we do away with ALU?Is FP operations are resource intensive ...
3
votes
2answers
744 views

Is the exponent in floating point numbers signed or unsigned

This may be sound like a stupid question, because, of course, it can be negative and, as Wikipedia states: A numeric variable is signed if it can represent both positive and negative numbers, and ...
0
votes
1answer
150 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 ...
2
votes
0answers
210 views

Why mantissa and exponent are stored differently in a float?

As we know, in IEEE 754 standard, float number's exponent and mantissa are stored differently. While the exponent is stored as an unsigned number, taking advantage of the bias, the mantissa is in sign-...
0
votes
0answers
106 views

How can a Number Represented without Normalization Technique?

Consider the following floating point Representation Mantissa is pure fraction in signed magnitude form . What is the representation of the binary number 1111.1111 $\times 2^{2} $ in hexadecimal ...
0
votes
2answers
176 views

What is meant by “uneven spacing” on number line when dealing with floating point numbers in computers?

I read some examples online on this subject, but none of them really gave an explanation. When I visualize the number line all I can see is evenly spaced numbers, I'm not grasping the notation of "...
1
vote
3answers
798 views

Comparing floating-point numbers as integers

In the article http://floating-point-gui.de/errors/comparison/, a method for comparing floating-point numbers is suggested: There is an alternative to heaping conceptual complexity onto such an ...
-1
votes
1answer
193 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?
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
726 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
758 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
325 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
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,...
2
votes
2answers
364 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}$ ...
1
vote
1answer
99 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
516 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 ...
3
votes
3answers
526 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 ...