# Questions tagged [floating-point]

Mathematical questions concerning floating point numbers, a finite approximation of the real numbers used in computing.

297 questions
17 views

### Determine rating of change from floating data

For example in this set of data (in ascending order of time) [ 100, 98, 105, 91, 108, 106, 110, 109] It is clearly the trend is rising but i would like to know how to determine the rate of change, ...
66 views

25 views

### Transform parabola to be tangent to line in point and through other point

Sorry for stupid question, but I give up. I've spent whole weekend to solve that and no results. Please help. I think I know the solution, but it doesn't work form me. So now I am not sure. I am not ...
29 views

### Removable singularities for rational functions with floating point coefficients

Suppose I have given a rational function $r(x)=p(x)/q(x)$ where $p$ is a degree $m$ polynomial and $q$ is a degree $n$ polynomial, both over the real numbers, and the coefficients of $p$ and $q$ are ...
42 views

### Adding two IEEE754 floating-point representations and interpreting the result.

This isn't for any class or homework. As part of my personal study, I'm trying to better understand the IEEE754 representation of decimal floating-point numbers in binary. I'd like to add two numbers: ...
33 views

90 views

### Floating Point Numbers - Machine numbers

Consider the set of machine numbers $M(10, 2, 0)$. (The "zero-length" for the exponent is to be understood such that there is only the sign ± and 0 available for the exponent. We interpret "+" as "+1" ...
45 views

### How many bits to represent these numbers precisely?

Consider the following numbers: $$19=10011_b, 12.75=1100.11_b, 7.125=111.001_b$$ What is the minimum number of bits necessary to represent the above three numbers precisely? A system like the IEEE ...
29 views

### How to get the fractional part of a product of large numbers with machine precision?

Let us have about 100 or so random (exact) floats such as: $$A_1 = 1234123.428\\ A_2 = 13713.4193\\ A_3 = 0.1332\\ A_4 = 123.13213\\ ...$$ Now I want to find an efficient way to get the fractional ...
49 views

### Numerical Analysis- Finding two closest machine numbers in single precision.

There is a question that is similar to this that was asked already, but the answer did not really make too much sense to me. Let's say I have a number 4096.000244 and I want to find the two closest ...
144 views

### Integer part of natural logarithm

Please, does anyone know of a algorithm to compute the integer part $n$ of natural logarithm of an integer $x$? $$n = \lfloor \ln(x) \rfloor$$ Preferably using integer arithmetic only (akin to ...
48 views

111 views

### Floating point representation

Consider the following two 8-bit floating-point representations based on the IEEE floating point format. The most significant bit represents the sign bit. Format A: There are $k=3$ exponent bits. ...
32 views

### What does the floating point arithmetic contribute to the rounding error in Mathematica?

I am a theoretical mathematician who works on the iterative method to find some generalized inverse of my interest. When I have tried some numerical example in Mathematica $11.0$, this does not ...
78 views

### What is the correct way to round 331.449999 to 1 decimal place

Should 331.449999 be 331.4 or 331.5? I can see a issue with a programming framework I am using. I think I am getting erroneous results in some cases and wanted to make sure I am using the right math ...
57 views

### Why floating point relative accuracy is needed?

In checking convergence of an iterative method, I have found that MATLAB uses the following code:dw = max(max(abs(W-Wnew) / (sqrt(eps)+max(max(abs(Wnew)))))); Here,...
65 views

### Understanding Floating point arithmetic

I really am in need of understanding floating point arithmetic, and I need an indepth knowledge of floating point arithmetic. The behaviour of most books that just touch the subject is like described ...
28 views

### Distinguising two error terms in rounding error

Considering two non-floating-point numbers $x$ and $y$, we write their floating point representation as $\operatorname{fl}(x)$ and $\operatorname{fl}(y)$ respectively. By $\circ$, we denote an ...
133 views

### Conditioning of the linear systems in the inverse or Rayleigh quotient iteration algorithms

I'm working through the book Numerical Linear Algebra by Trefethen and Bau. In Lecture 27 (and exercise 27.5), the following claim is made about the inverse iteration algorithm: Let $A$ be a real, ...
114 views

### Understanding the amount of FLOPS required to perform a single iteration in GCR

Exercise: Determine the amount of memory and flops for iteration $i$ of the following (GCR) algorithm: \begin{split}\text{for }&i = 1,2,\ldots\text{ do}\\&s^i = r^{i-1},\\&v^i = As^i,\\&...
### Writing A Number In Floating Point With $5$ Significant Digits
Write the number $496354.1$ with $5$ significant digits by chopping and rounding Now for chopping we can write it as $0.49635*10^5$ or $4.9635*10^4$ which is the correct way?
### How to convert $\ln x - \ln y$ into a more accurate floating point representation?
I have an equation $\ln(x) - \ln(y)$ where x and y are very close to eachother. For example if $x = 5.1234$ then something like $fl(\ln(5.1234)) = 1.6338$ (with 4 significant digits). If $y = 5.1233$ ...