Questions tagged [rounding-unit]

45 questions
15
votes
2 answers

Which distances can I run on my treadmill?

This is a real-world question, prompted by some unusual features on my treadmill and which I thus think about while running. In a sub-menu on my treadmill, I can select a distance that I want to run. If my unit setting is "miles", the distances…
7
votes
3 answers

What is the function for "round n to the nearest m"?

Where $n \in \mathbb{R}$ and $m \in \mathbb{R}$, what is the function $f(n, m)$ that can achieve rounding behavior of money where the smallest denomination is not an power of ten? For instance, if a 5¢ coin is the smallest denomination (like in…
Ky -
  • 1,346
6
votes
2 answers

Does $2.4\overline{9}$ round to $2$ or $3$?

Does $2.4\overline{9}$ round to $2$ or $3$ when rounded to the nearest whole number? When rounding to one digit, we generally only take the first decimal space, which in this case is $4$. So on that front, it should round to $2$. However,…
6
votes
3 answers

Why is $0.5$ rounded up to $1.0$? It's not closer to $1$ than $0$?

Why is 0.5 rounded up? It is exactly halfway between 0 and 1, so it is not closer to 1...nor is it closer to 0. It is exactly halfway between them. The same principle applies to other things like 11.5 or 23.5. The value is exactly halfway between…
DrZ214
  • 1,419
5
votes
0 answers

Error in computing $\frac{e^x-1}{x}$ for $x$ near $0$.

My book says that if we want to compute $\frac{e^x-1}{x}$ for $x$ near $0$ the following algorithm is a bad idea: z1 = (exp(x) - 1)/x while the following one is good: z2 = (y - 1)/log(y) I have proved that the first algorithm generates a large…
4
votes
2 answers

If a number is being rounded to 2 decimal places, should the third decimal place be rounded by the fourth first?

I came across this number: 3.96146 It needs to be rounded to three decimal places. Should it be 3.961 or 3.962 if it is considered that the fifth decimal place rounds up the fourth one which in turn rounds up the third one?
3
votes
1 answer

Representation of integers by $A = B^{\frac{5}{4}} + C^{\frac{5}{4}}$

Let $n>-1$ be an integer and $f(n)$ be the integer part of $n^{\frac{5}{4}}$. And to avoid confusion define $f(0)=0,f(1)=1$ and all $f(n)$ as the integer part of the positive real values for $n^{\frac{5}{4}}$. ( no complex or negative branches for…
3
votes
1 answer

Rounding unit vs Machine precision

I'm not sure if this question should be asked here... For a general floating point system defined using the tuple $(\beta, t, L, U)$, where $\beta$ is the base, $t$ is the number of bits in the mantissa, $L$ is the lower bound for the exponent and…
2
votes
2 answers

Is there a spelling mistake or am I missing something

Here, $[ \cdot]$ is $\lfloor \cdot \rfloor $ floor function. N $ \in N$. Where did $\frac{[Nx]} N + \frac{1}{2N}$ came from and how does $x$ differs by $\frac{1}{2N}$. Shouldn't it be $\frac{1}N$ if $x$ is an integer.
2
votes
0 answers

Why can matrix rounding be seen as a max flow problem?

For a general max flow problem, we know that each intermediatte node must give away the same amount of flow it receives. Besides this, we also know that the amount of flow that leaves the origin node ($s$) should be the same amount received by the…
2
votes
1 answer

How to Round Currency After Conversion

Is there a way to round smaller currency sub-units to regular ones, so as to minimize the rounding error? I've come across things like stochastic rounding but I don't know how I would apply it to my case (and I just know how much slack I'm going to…
ygh
  • 123
1
vote
1 answer

Solve for range of $y$ in $x = \operatorname{round}(y + c)$

Suppose I have $$ x = \operatorname{round}(y + c) \\ $$ I want to solve for $y$, though it's not really possible in this case. Is it possible to get $y$ as a range of values based on some lower and upper bound where those bounds are dependent on…
24n8
  • 1,523
1
vote
1 answer

Round the following number to $4$ significant figures: $794834.$

Round the following number to $4$ significant figures: $X=794834.$ For the number $X=794834$, I simply observed that all the digits in here are significant. The $4^{th}$ significant digit in this case, is $8$ and the $5^{th}$ digit is $3$. Now, as…
1
vote
0 answers

What do you call this generalized floor function?

Given an $n$-tuple of ordinal values $\mathbf{x}$, the members of which are each comparable to one another and a single value $y$, $\mathrm{min}(\mathbf{x})\le y$, which is comparable to any of the members of $\mathbf{x}$, maximize $x\in…
1
vote
1 answer

Is there an icon latin, glyph or symbol that means rounding?

Is there an icon that means rounding? I'm not talking about notation but specifically an icon, glyph or symbol. For example, "pi" has the icon $\pi$. I would also accept an icon that means integer (as opposed to decimal). I was looking at this…
1
2 3