Why trunc(4.9999999999999999) ==5, but trunc(4.999999999999999) ==4?
27
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
63628
Here's an example:  Double d = (1/3); System.out.println(d);   This returns 0, not 0.33333... as it should.  Does anyone know?
80740
Using 5000-digit precision in PARI/GP, I discovered that the fractional part of $(\sqrt{2}+\sqrt{3})^{2008}$ is extremely small, less than $10^{-999}$.  Is there a simple explanation for this fact ?  This looks like a Pisot number issue (similar questions have already been studied on MSE, see for example ), but it’s a more complicated situation.   Related :
71362
I can see that this works for any integer $n$, but I can't figure out why this works, or why the number $42$ has this property.
9683
Hey all I asked this over  =) and I got a good answer but I still have no idea whats going on. I want to know how the expression got to the answer and maybe the math behind how it was reasoned.. the steps if you would be so kind. The likelihood is I don't understand the equation.   I'm not a big maths person please be gentle :p     For all those playing along at home I'm reading Absolute Java 5th   Edition by Walter Savitch (Chapter 2 Page 66).      The Expression  double d = 12345.123456789; System.out.printf("START%12.5e END %n", d);       The Answer  START 1.23451e+04END       I understand the basic principles of this printf method's arguments   for example I know the '%' represents the start of the parameters.   '12' is the number of spacing, '.5' is the times the decimal point   will move.... I see the decimal point has moved 4 places towards the   left... can someone explain the principles of e-notation. Also how   this expression came to this answer =).      As far as e-notation go's its meant to be scientific notation;      So like 5.89e-4 would mean 0.000589 (move the decimal place if minus   left if not move the decimal place right).
73404
I was doing some exercises on error propagation when I came across this problem:  $4\pi^2/(0,034 \pm 0,004 \space s^2/cm)$  I calculated my uncertainty to be $\Delta$ = 136 $cm/s^2$  And so the hole thing gives me: $(1200 \pm 136) \space cm/s^2$.  Now going into my question I rounded $4\pi^2/0,034 = 1161.12993$ to $1200$ which makes sense since my uncertainty is 136 but in the solution to this problem $136$ is rounded to $100$ and that's not making much sense to me.  So should I always round my uncertainty to the nearest hundred (assuming my uncertainty has 3 digits)?
52847
I found two examples that I'd like to understand:  Example 1: Find $112358132134 \mod 9$.  Solution is: $1+1+2+3+5+8+1+3+2+1+3+4 \mod 9 = 7 \mod 9 = 7$  Example 2: Find $62831853 \mod 11$.  Solution is: $(-6)+2+(-8)+3+(-1)+8+(-5)+3 \mod 11 = -4 \mod 11 = 7$  My question is: Based on what property we sum the digits of the number ( as Example 1) or subtract (as Example 2)?
122043
What I get is $4 \cdot 54k + 27(n(n-1)) - 2$.  I understand first two terms but $-2$ is giving me a headache. I suppose to be true every term should be divisible by $54$. Or did I make wrong conclusion?  P. S: Is there mathjax tutorial?
27648
double r = 11.631; double theta = 21.4;   In the debugger, these are shown as 11.631000000000000 and 21.399999618530273.  How can I avoid this?
5370
I was surprised when I heard zero is plural, and even 1.00001 is plural.  Then, what about following numbers ?  (1) 1.00  which means the value measured  between 0.995-1.004, having possibility that it was exactly 1.  (2) 0.99999.....  which is mathematically equal to 1. Also, are others that are mathemattically equal to 1 than this, treated completely same as 1?  (3) -1  Is this singular? Or negative numbers are generally plural?  (4) i = square root of -1  I know it's weird to count things with imaginary numbers, nonetheless, if you were to count, which form, plural or singular, would you be to use?  That's it.
506
In the decimal system: $...-3, -2, -1, 0, 1, 2, 3...$ In the binary system: $...-11, -10, -1, 0, 1, 10, 11...$ In the unary system: $-111, -11, -1, \text{ ??? }, 1, 11, 111...$   I was only able to find a related question but none with an answer so far:
102992
I  have come up with the following expression to convert 5.1234   to   5° 7`24.24"   toint ($x) || '° ' || toint((($x) - toint ($x)) * 60) ||'`' || substr( (tostring(((($x) - toint ($x)) * 60) - toint((($x) - toint ($x)) * 60)) * 60),1,5) || '"'  Here’s the problem : for some  points such as 5.1234, it works. but for others,  it doesn’t.  I suspect the problem is the integer conversion which round up the decimal figures instead of truncating it.  Is there any other option? thanks.
107105
Find the $1000$th digit after the decimal point of $\sqrt{n}$, where $n=\underbrace{11\dots1}_{1998 \text{ 1's}}$.   Obviously, $\underbrace{11\dots1}_{1998 \text{ 1's}}=\dfrac{1}{9}\left(9\cdot10^{1997}+9\cdot 10^{1996}+\dots+9\right),$ so we want to find $\left(\dfrac{10^{1998}-1}{9}\right).$ If only there was some way to convert this expansion into some closed form. I'm not sure if calculus would be useful. The problem asks for a single digit, so if we consider repeating digits, everything will be a lot easier. There seems to be a pattern in the decimal expansions of numbers consisting of only $1.$  For instance,  $$\sqrt{1}=1,$$ $$\sqrt{11}=3.3166247...$$ $$\sqrt{111}=10.5356537...$$ $$\sqrt{1111}=33.3316666...$$ $$\sqrt{11111}=105.408728...$$ $$\sqrt{111111}=333.333166...$$ $$\sqrt{1111111}=1054.09250...$$  Every term of the form $\displaystyle\sum_{n=0}^{2k+1}10^n$ has $k+1$ $3$'s at the beginning and $k+1$ 3's right after the decimal expansion, followed by one $1,$ and $2(k+1)$ $6$'s. Proving this would prove that the $1000$th digit is $1.$ This is the same as showing that $\sqrt{\left(\dfrac{10^{2m}-1}{9}\right)}=\dfrac{10^{m}-1}{3}+\dfrac{1}{3}-\dfrac{1}{6}\cdot 10^{-m}+\epsilon_m$ where $|\epsilon_m|&lt;10^{-2m}.$  Edit: the previous question I asked was inspired by the current one, but the previous question seemed to have a rather unpleasant answer, so I changed it.
44849
Does anyone know why, using SQLServer 2005  SELECT CONVERT(DECIMAL(30,15),146804871.212533)/CONVERT(DECIMAL (38,9),12499999.9999)   gives me 11.74438969709659,  but when I increase the decimal places on the denominator to 15, I get a less accurate answer:  SELECT CONVERT(DECIMAL(30,15),146804871.212533)/CONVERT(DECIMAL (38,15),12499999.9999)   give me 11.74438969
11673
Just saw , and realized that  1/9801 = 0.(000102030405060708091011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969799)(repeat)  Similar properties are also exhibited by numbers , , .. and so on. Edit: fixed periodic start and end It is not very obvious to me why this happens. Is there some simple explanation to this property?
45377
I have been forewarned about it, I have read the  here, but I haven't seen a counter example where it doesn't work. I know that it isnt really a fraction, but does it effectively get the same result in all cases, or are there counterexamples I must be warned about.   I do not mean obvious counter examples, like $$\frac{dy}{dx}+\frac{du}{dv} = \frac{dydv+dxdu}{dx dv}$$ which as far as I know doesn't really mean anything.
76183
Okay, I'm not much of a mathematician (I'm an 8th grader in Algebra I), but I have a question about something that's been bugging me.  I know that $0.999 \cdots$ (repeating) = $1$. So wouldn't $1 - \frac{1}{\infty} = 1$ as well? Because $\frac{1}{\infty} $ would be infinitely close to $0$, perhaps as $1^{-\infty}$?  So $1 - 1^{-\infty}$, or $\frac{1}{\infty}$ would be equivalent to $0.999 \cdots$? Or am I missing something? Is infinity something that can even be used in this sort of mathematics?