# Questions tagged [floating-point]

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

172 questions
Filter by
Sorted by
Tagged with
36 views

### Do all programming languages adhere to the IEEE 754-2008 standard?

I am well aware that the float data type's maximum value is approximately 1.8E308, which means that across the various ...
29 views

### What are the smallest and biggest negative floating point numbers in IEEE 754 32 bit?

I am stuck with a question that asks for smallest and biggest negative floating point numbers in IEEE 754 32-bit (their representation and decimal numerical value from which one can approximate the ...
34 views

### absurd output on a trivial function in python [duplicate]

k=1 while k!=0: x=float(input('Enter x:')) op=(1/(1+x))+(1/(1+(1/x))) print(op) I tried to test this function on python, clearly the output should ...
28 views

### How can I calculate the exponential integral?

(I'm not sure this is the right forum.) I'm writing a program that uses the prime-counting function. Right now, I'm using x/log(x), but I want to switch to ...
22 views

### What's the least signifcant bit of a mantissa system?

If Mantissa is a 1-dot-M fixed-point number whose most significant bit is always 1 then, how is the least significant bit calculated? I know the least and most significant bit of the mantissa ...
35 views

I am studying over my notes, and there is something I don't understand about $e_m$. We represent the floating point numbers as $1.d_1d_2...d_t \times \beta^e$. Now, my professor defines $\epsilon_m$ ...
33 views

31 views

### Why multiplying float number by multiple of 10 seems to preserve better precision?

It is famous that for float numbers: .1 + .2 != .3 but 1+2=3 It seems that multiplying floats by 10 allows you to preserve ...
67 views

### How does a computer compute negative(-) and positive(+) Infinity?

If we divide (1.0/0.0) we will get +Infinity and if we divide (-1.0/0.0) we will get -Infinity. How does a computer calculate this value internally?
46 views

### Can we represent $\sqrt{2}$ exactly even with infinite bits in mantissa [closed]

Can we represent $\sqrt{2}$ exactly even with infinite bits in mantissa in floating point notation or otherwise. We actually have to prove this is not possible. But why can't we if we have infinite ...
25 views

### Floating point substraction

if $x=1.0e38=1.0 * 10^{38}$ and $y=3.0$ i want to find $(x-x)+y$ and $(x+y)-x$ i think the value of (x-x)+y will be just substract $x-x=0 + y=3.0 = 3.0$ but how can i perfom addition of different ...
70 views

### Polynomials - using Newton's method, or not?

I have to find a root of polynomial of degree $n\ge2$. I need to write code to calculate the root for different values of $n$. Only 1 real positive solution is needed. I can use general Newton's ...
28 views

### How many floating point ops were performed worldwide over a time interval [closed]

I am looking for information regarding the evolution of computing capability. Specifically I would like to know how many floating point operations were performed worldwide from, say, the deployment of ...
61 views

### Computing an Expression

I am writing code to evaluate the following expression: $$\frac{(a+b+c)!}{a! b! c!}$$ where $a$, $b$ and $c$ are on the range of $10$ to $500$. The result is going to be a floating point number. ...
100 views

### How much can we trust mathematical software when working with large numbers, and how much memory it needs to work with these numbers?

For example, I want to evaluate the expression: $3^{3^{{3}^{3}}}$ so I used wolframalpha.com (it's free, and I don't own any software), which returned the scientific notation of the number above, ...
55 views

### numerically stable log1pexp calculation

What are good approximations for computing log1pexp for single precision and double precision floating point numbers? Note: ...
78 views

### Floating point arithmetic

I need to change x1 = 0.3 and x2 = -0.29 to a FP(floating point) number with one sign bit, a 4 bit mantissa, a 3 bit exponent. The results I got are: x1: 0 001 0011 x2: 1 001 0010 I am also trying ...
134 views

### Convert $1.75\times10^{15}$ to IEEE-32 format?

$1.75\times10^{15}$ I know how to convert decimal to binary $(1.75)_{10}$ is equal to $(1.11)_2$ But to represent $10^{15}$ is the main problem for me. I can solve the question but this is the ...
63 views

29 views

### Numbers lying between single and double precision

The IEEE floating point number format is defined as $$s\underbrace{c_1\dots c_m}_\text{exponent}\underbrace{f_1\dots f_n}_\text{fraction}\text{ (*)}$$ with $s, c_i, f_j$ being either $1$ or $0$. The ...
24 views

### IEEE-754 and machine numbers

I've been trying to wrap my head around machine numbers like the unit roundoff (u) and epsilon (e) in combination with the IEEE 754 standard. My textbook states some things that don't really make ...
143 views

### Algorithm challenge: build a pile of 'n' cubes whose total volume adds up to 'm'

I'm working on solving an algorithm problem defined as follows (important parts in bold): Your task is to construct a building which will be a pile of n cubes. The cube at the bottom will have a ...
39 views

Is there any generic algorithm which implements a floating point radix conversion? Lets say we have a $p$-digit FP number $A = \sum_{i=0}^{p-1} A_i \beta^{e-i}$ in radix $\beta$ and with $0 \leq ... 0answers 222 views ### Why is the method of im2col with GEMM is more efficient than the method of direction implementation with SIMD in CNN The convolutional layers are most computationally intense parts of Convolutional neural networks (CNNs).Currently the common approach to impement convolutional layers is to expand the image into a ... 1answer 122 views ### Floating point Euclidean norm optimization Past few days I've been struggling with floating point number exercises, trying to learn how they work and what are their limitations. The exercise I've encountered today is as follows: The ... 1answer 282 views ### How to compute relative error for the rounding of floating point numbers when the rounded number is 0? I have asked this question on Stack Overflow, I am asking it here in the hope to get more traction. The relative rounding error for a floating point number x is defined as$e_r = |\frac{(round(x) -...
today I had to deal with this exercise: If $x \approx y$, we might expect some cancellation in computing $log(x)- log(y)$. On the other hand, $log(x) - log(y) = log(\frac{x}{y})$, and the latter ...
During my preparation for an exam, I've come across an exercise that was focused on precision calculation with floating point numbers. It goes like this: Consider the expression : \frac{1}{1-x}-\...