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

(Numerical Analysis) What is the largest double float represented for the gamma function and $n!$

Consider that \begin{align} \Gamma(n+1) = n! \end{align} for any integers. I then got the following two questions: What is the largest value of $n$ for which $Γ(n+1)$ and $n!$ can be exactly ...
1
vote
0answers
32 views

Bisecting Intervals of floating point numbers containing 0 and infinity fairly

It is seldom considered that floating points are not evenly distributed in the real number line. I've been working with interval arithmetic and noticed when bisecting $[a,b]$ on the real number line ...
1
vote
0answers
32 views

Can Radix Sort be modified for signed ints and/or floats?

A few months ago I learned about the magic that allows radix sort to run in O(n) time and space. Most tutorials on radix sort say it is useful for very large ...
0
votes
1answer
32 views

IEEE 754 conversion

I'm trying to convert 3.2 into IEEE 754 format. We find that $(3)_2=11$ and we also find that $0.2*2=0.4 -0$ $0.4*2=0.8 -0$ $0.8*2=1.6 -1$ $0.6*2=1.2 -1$ and this cycle repeats so $.2=00110011...$ ...
4
votes
0answers
47 views

Uniformly random decimal numbers

Due to finite precision of number representations, we face situations like: In: 0.1+0.1+0.1==0.3 Out: False (on my ...
1
vote
0answers
16 views

(Branchless) Bitonic Sorting Network for a Set of Floating Point Numbers

In the past I've implemented a branchless Bitonic Sorting Network on a gpu using CUDA, for integers. I am facing a related problem: In my Order Independent Transparency implementation, I would like to ...
1
vote
1answer
31 views

How can vector angle comparison between lattice points be done without using floating-points? (Convex Hull)

Let's say I have a point $(x_0, y_0)$, and some other points $(x_1, y_1), (x_2, y_2) ... (x_n, y_n)$, such that all of them are lattice points; all have integer coordinates. Let's further assume that ...
1
vote
2answers
40 views

How many Integers can be represent in Double-Precision floating-point form

How to calculate the number of Integers that can be represent in Double-Precision floating-point form?
1
vote
1answer
51 views

Prove every number in double precision 32-bit floating-point format can be represented in 64-bit format

Theorem: Prove every number in double precision 32-bit floating-point format can be represented in double precision 64-bit floating point-format. 64-bit format: Attempt: Let $ b = b_0 ,...,b_{31} $ ...
1
vote
1answer
36 views

Why does floating point become less accurate as the powers of 2 increase?

https://fabiensanglard.net/floating_point_visually_explained/ I was reading this article where the exponent and the mantissa are explained as the window and offset respectively. As the gap between ...
0
votes
0answers
33 views

Is there a way to convert FLOPS to bit operation per second

My problem is the following: I have $N$ inner products to compute in parallel every second. Each of the vectors in those inner product is composed of $7$ bits. I want to know for which $N$ it starts ...
0
votes
0answers
31 views

Adding two numbers in half-precision IEEE754 standart

I have to add two numbers using IEEE754: -14.1875 and -7.4375. I managed to convert them to half-precision numbers in IEEE754: 1 10010 1100011000 (-14.1875) ...
2
votes
1answer
93 views

Unit conversion - Better to divide by an integer or multiply by a double?

I currently have a long timestamp measured in units of 100ns elapsed since January 1st, 1900. I need to convert it to milliseconds. I have the choice of either ...
1
vote
2answers
133 views

Half precision floating point question -- smallest non-zero number

There's a floating point question that popped up and I'm confused about the solution. It states that IEEE 754-2008 introduces half precision, which is a binary floating-point representation that uses ...
1
vote
1answer
45 views

Floating Point Arithmetic with 3 bits mantissa

Find all values of $ x ∈ R $ such that x + 1 = 1 in floating point arithmetic with 3 bits mantissa. How do we represent number 1 in floating point arithmetic with 3 bits mantissa I wonder? After that, ...
3
votes
2answers
98 views

Python versus Matlab on the quantity 1/0

Python and Matlab seem to disagree on the division by 0. Python: ...
1
vote
3answers
169 views

Negative Numbers in 32 bit Floating Point IEEE Numbers

So I understand the logic behind converting positive decimal numbers to IEEE 32 bit floating numbers but I'm not completely sure behind the negative one's. If for example we have a decimal number say -...
1
vote
2answers
47 views

Adding two numbers in base 2(floating point) vs Multiplying two numbers in base 2(floating point)

Is it true that adding two numbers in base 2 is more complex than multiplying them? If so can someone please explain why this is the case?
1
vote
2answers
140 views

Prove that $1^\text{nan} = 1.00$

I know that for most computation involve nan (not a number) the result is a nan itself except for some cases. For example, $1^{\text{nan}} = 1.00$ which proven by mathematicians to be true. I tried to ...
2
votes
2answers
23 views

Floating point bitwise comparator. If f1 and f2 are floating point numbers with the following properties can we always say f1 > f2?

Recall floating-point representation: Suppose $f$ is a floating-point number then we can express f as, If $f$ is normal: $$(-1)^{s}\cdot2^{e-127}(1 + \sum\limits_{k=1}^{23} b_{23-k}\cdot 2^{-k})$$ If $...
0
votes
0answers
6 views

Finding fraction from a double [duplicate]

You are given the decimal expansion (double) of a rational number $p/q$, where $\gcd(p,q)=1$. How can you efficiently determine what $p$ and $q$ are? I don't know how to solve this, but I think we ...
0
votes
0answers
32 views

Convert $8.75×10^{6}$ to IEEE-32 format?

There is a similar question already asked on this site but does not have an answer as to how the 10x was converted into 2y. I know how to convert 8.75 or 875 into IEEE representation. But what about ...
1
vote
1answer
156 views

What is the machine epsilon and number of mantissa bits for TI-83?

I am trying to determine how many bits the TI-83 Plus uses to store floating point numbers. I am using the algorithm for approximating the machine epsilon given in "Numerical Mathematics and ...
1
vote
0answers
32 views

How close are current computer technologies in terms of energy efficiency to the Landauer Limit?

I'm trying to figure out how close (in orders of magnitude) current computer technologies are in terms of energy efficiency to the Landauer Limit. However, I'm finding (seemingly) conflicting ...
0
votes
2answers
88 views

How to determine the set of real numbers corresponding to a given floating point number?

Let's say we consider IEEE 754 double precision floating-point numbers, and we use RNTE - Round To Nearest, Ties to Even - rounding. I know that the RNTE rounding works this way: given two consecutive ...
3
votes
1answer
128 views

Logic behind choosing the exponent bias as $2^7 -1$ instead of $2^7$ in $32$ bits IEEE-754 floating point representation

The $\text{IEEE-754}$ uses $32$ bits to represent single precision floating point numbers. The partitions of the register are as follows: ...
0
votes
0answers
17 views

What is the currently know fastest algorithms to convert each individual Java primitive and Number types to a Char Array/String

What is the currently know fastest algorithms to convert each individual Java primitive and Number types to a Char Array/String number representation while ...
1
vote
1answer
1k views

How to represent zero as floating point number?

For the floating-point number, we have the form $\pm d_0.d_1d_2···d_{P-1}\times\beta^E$ $\pm$ --------------------------- sign $d_0.d_1d_2···d_{p-1}$ --------- significant $\beta$ --------------------...
0
votes
0answers
38 views

Are floating-point numbers normalised by computers or humans?

I keep seeing posts and articles about how to normalise a floating-point number, why that's done and how such a number is represented in binary. But no one seems to mention who/what the normalisation ...
0
votes
2answers
175 views

How are bitwise operators used in normalisation of floating-point numbers?

After having spent a significant amount of time googling this topic, I am still struggling to confidently answer the following question: ...
1
vote
1answer
367 views

Converting Decimal Numbers between 0 and 1 to Binary

I've been playing around with a program I wrote that converts decimal numbers to binary numbers and i've noticed that eventually, after applying the algorithm (multiply by 2, subtract 1 if greater ...
1
vote
2answers
44 views

Floating-point oblivious way to compute multiset numbers

I have to compute $R = \left(\!\!{n + 1\choose k}\!\!\right)$, which happens to be: $$ R = \left(\!\!{n+1\choose k }\!\!\right) = \binom{n+k}{k} = \frac{(n + k)!}{n!k!} = \frac{(n+1)(n+2)\cdots(n+k)}{...
1
vote
2answers
55 views

Validity of Algorithm for Testing Two Floating Point Numbers

This question is related to the epsilon- (or delta- if you prefer) test for floating point equality. But my question is not how to do it. Instead I have a related algorithm for testing equality, and I ...
0
votes
0answers
37 views

New way of representing floating point

I want to create a new way of representing floating point. In standard IEEE floating point, we have 1 bit to represent sign, 8 bits to represent exponential and 23 bits to represent significand. In ...
0
votes
1answer
97 views

IEEE 754 addition wrong result floating point numbers

I want to add two IEEE 754 numbers. I followed the steps to add two 754 numbers. However the result it not correct. Number 1: S:0 E:01111111 M:11111111111111111111111 Number 2: S:0 E:01111111 M:...
0
votes
2answers
62 views

Cancellation of inequalities in floating point arithmetic

In finite precision floating point arithmetic the associative property of addition is not satisfied. This is, it is not always the case that $$(a+b)+c=a+(b+c)$$ Even $a=(a+b)-b$ is not always true. To ...
0
votes
1answer
39 views

How does value decompression work for Facebook's Gorilla in the case where count of leading zeroes is not stored

I am referring to this paper: http://www.vldb.org/pvldb/vol8/p1816-teller.pdf My question is regarding section 4.1.2 where it says: When XOR is non-zero, calculate the number of leading and ...
1
vote
1answer
32 views

Help comparing relative error for different parenthesizations of addition

I am given two functions: $ fl(fl(x+y)+z) $ and $ fl(x+fl(y+z)) $ and asked to derive their relative error. Then, given a set of conditions: a) $ x < y < x $ b) $ x > 0, y < 0, z > 0 $...
0
votes
0answers
88 views

Floating point binary number to a 7 segment decimal display

I have covered floating point (32 bit) conversion from float to decimal and decimal to float. I am happy with the theory and I have created a conversion tool in Excel VBA which works just fine ...
1
vote
1answer
136 views

What is the 2's complement answer of 16.5?

According to this post it is saying Two's complement is only for integers, but in Wolframalpha is is saying the Two's complement of 16.5 is 0010000.1, how?
5
votes
5answers
383 views

fast and stable x * tanh(log1pexp(x)) computation

$$f(x) = x \tanh(\log(1 + e^x))$$ The function (mish activation) can be easily implemented using a stable log1pexp without any significant loss of precision. Unfortunately, this is computationally ...
1
vote
1answer
499 views

Converting a number to 16-bit Floating Point Format

I want to convert the number -29.375 to IEEE 745 16-bit floating point format. Here is my solution: The format of the floating point number is: 1 sign bit unbiased exponent in 4 bits plus a ...
2
votes
1answer
89 views

Numerical Accuracy & Sorting Algorithms?

Sedgewick and Wayne talk about how sorting algorithms and, specifically, priority queues are used in devising ways to improve accuracy in floating-point calculations: https://algs4.cs.princeton.edu/...
-1
votes
2answers
2k views

Write the smallest positive number that can be represented by the floating point system

Using a normalised floating point representation box with an 8-bit mantissa and a 4-bit exponent, both stored using two’s complement. (a) Write the smallest positive number that can be represented by ...
1
vote
1answer
77 views

Is the exponent bias $2^{n-1}-1$ or $2^{n-1}$

I'm a bit confused with the exponent bias. The sources I found online claim that it is either $2^{n-1}-1$ or $2^{n-1}$, $n$ is the number of bits used for the exponent. In my book when given examples ...
0
votes
1answer
75 views

Understanding How Double Precision Numbers are Stored in a Computer

I am reading Numerical Analysis by Walter Gautschi. I am somewhat confused by the following quote from page $5$: To increase the precision, one can use two machine registers to represent a machine ...
2
votes
1answer
43 views

Question About Floating Point System

I have begun reading Numerical Analysis by Walter Gautschi. On page $3$, the author introduces the floating point number system as follows: a floating point number is a number representible as $$ \...
1
vote
2answers
1k views

Why is there a precision loss for floating-point numbers?

It could be a silly question, yet I'm not able to understand. In modern day, computers, we have integers with million digits length. Even in my ordinary 2GB laptop, I can calculate values of numbers ...
2
votes
1answer
90 views

Max flow algorithm for floating-point weights and E~=10*V

Could you, please, suggest a maximum flow algorithm for a graph with floating-point weights and the number of edges approximately equal to the number of vertices? I.e. ...
0
votes
1answer
290 views

Normalization in IBM hexadecimal floating point

According to the Wikipedia link of IBM hexadecimal floating point: Consider encoding the value −118.625 as an IBM single-precision floating-point value. The value is negative, so the sign ...

1
2 3 4 5