Difference in outputs while printing value stored in a variable and printing value directly using printf() I am trying to write a simple C program that takes the input from user in metres and prints the output in kilometres, yards and miles rounded to 4 decimal places. I have used this 1 meter = 0.001 kilometers = 1.094 yards = 0.0006215 miles When I write this, I get the output as intended: #include &lt;stdio.h&gt; int main() {    int m;    float km, y, mi;    scanf(&quot;%d&quot;,&amp;m);    km=(m*0.001);    y=(m*1.094);    mi=(m*0.0006215);    printf(&quot;%.4f\n%.4f\n%.4f&quot;,km,y,mi);    return 0; }  Output: 0.1000 109.4000 0.0622 But, when I write this I get the third output wrong: #include &lt;stdio.h&gt; int main() {    int m;    scanf(&quot;%d&quot;,&amp;m);    printf(&quot;%.4f\n%.4f\n%.4f&quot;,(m*0.001),(m*1.094),(m*0.0006215));    return 0; }  Output: 0.1000 109.4000 0.0621 Can you please help me find the reason for this difference?  Edit-1 here I gave input 100. float y=100*0.0006215; printf(&quot;%f&quot;,y);  gave output 0.062150 and this printf(&quot;%f&quot;,100*0.0006215);  also gave output 0.062150  Edit-2 float y=100*0.0006215; printf(&quot;%.4f&quot;,y);  gave output 0.0622 while: printf(&quot;%.4f&quot;,100*0.0006215);  gave output 0.0621 whereas in Edit-1 both displayed the same output.
Is floating point math broken? Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
How can I re install the APT Tool? How can I stop the symbolic x coords to be plotted twice? Transit visa requirements at Narita Airport Both are in the present perfect, but one uses the verb 'to go' and the other 'to be'. Is there a rule for this?  Is there any chance that the differences between "I have been" vs. "I have gone", are differences in English dialect (I don't know if this is the right word).  Edit Could I say that North American English speakers use "I have gone", and maybe U.K speakers say "I've been"? Or vice versa. Why didn't the Order of the Phoenix assist with the trio (i.e.  Harry Potter, Ron Weasley and Hermione Granger) in the Horcrux hunt? How can I get my graphics card to be recognized in System Info? Are PHP variables passed by value or by reference? How can I set a dark theme in TeXstudio? After perusing , I'm considering switching from TeXmaker (in which I use the preset "dark theme") to its fork, TeXstudio.  What I mean by "dark theme" is a dark background with suitable text colours, which, in my experience, is easier on the eyes than a bright background is. Here is an example:    TeXstudio doesn't seem to offer any preset dark theme, though, which means I have to customise all the colours/syntax-highlighting settings from scratch to get a dark theme even remotely usable. This can prove very time-consuming.   I'm aware this might sound a bit cheeky but,   if you are a long-time TeXstudio user, and you have fine-tuned the editor colours to get a visually pleasant dark theme,   please consider posting the relevant lines from your settings (.txsprofile or .tmxprofile) file as an answer below.  TeXstudio users who would like to use a dark theme could then build on your settings to fine-tune their own. Import error when opening empty notebook This question is about the net speed.  I'm from China, and I find that opening pages on Stack Overflow is very fast, normally within a range of 1 to 4 seconds. This speed is very good for a website outside China; it's even faster than some native websites.  Not every website outside China has such good speed, so I am wondering why and how Stack Overflow manages to be so quick. In RSA, why is it important to choose e so that it is coprime to φ(n)? When choosing the public exponent e, it is stressed that $e$ must be coprime to $\phi(n)$, i.e. $\gcd(\phi(n), e) = 1$.   I know that a common choice is to have $e = 3$ (which requires a good padding scheme) or $e=65537$, which is slower but safer.  I also know that for two primes $p,q$, we have $\phi(pq) = (p - 1) (q - 1)$  Now, let me give a (simple) example:  Say I choose $e = 3$, and two random primes $p = 5$ and $q = 13$.  I can now compute $\gcd(3, \phi(5 \cdot 13)) = 3$.  This reveals that $3$ and $\phi(n)$ are not coprime. I assume this could also happen for large values of $p$ and $q$, and likewise for another $e$. I therefore assume that the RSA algorithm must check that $\gcd(e, \phi(pq)) = 1$. But let's assume it doesn't.  How does RSA become vulnerable if $\gcd(e, \phi(pq)) \neq 1$? Can't quantum teleportation be superluminal some percentage of times? I apologize if this is a really silly question.   In the (textbook) quantum teleportation algorithm, in the step right after Alice has measured her system but before she has sent her classical information to Bob, she is about to send one of the following values: 00,01,10,11.   What if Bob doesn't want to wait and simply takes a guess? Wouldn't there then be superluminal communication 25% of the time? $ df -kh Filesystem      Size  Used Avail Use% Mounted on udev            7,8G     0  7,8G   0% /dev tmpfs           1,6G   19M  1,6G   2% /run /dev/sda2       622G  227G  364G  39% / tmpfs           7,8G  1,1G  6,7G  14% /dev/shm tmpfs           5,0M  4,0K  5,0M   1% /run/lock tmpfs           7,8G     0  7,8G   0% /sys/fs/cgroup /dev/loop1      143M  143M     0 100% /snap/inkscape/2527 /dev/loop3       79M   79M     0 100% /snap/core/1441 /dev/loop0       79M   79M     0 100% /snap/core/1577 /dev/loop4       79M   79M     0 100% /snap/core/1512 /dev/loop2       62M   62M     0 100% /snap/pencilsheep/5 tmpfs           1,6G   92K  1,6G   1% /run/user/1000   What are these /dev/loop device files? My RAM is always full. Is this related? In many scientific papers, the article before the word "Equation" is omitted. Is there any grammar statement behind this? For instance:     "Equation (8) contains various approximations, and we have to check their consistency." My daughter applied at the Italian Consulate in Philadelphia, and they gave her two entries for 20 days (we thought it was for 20 days each entry). She was in Italy 12 days, then went to England for 1 week and flew to Venice to take a 10-day cruise. She couldn't make it because they said she has only 8 remaining days, but she still has a land tour already paid this week.  What can she do? Can she extend the Schengen visa for 12 more days? Right now, she is in Madrid, but next week she has to fly from Barcelona to Paris to start with the tour. What would happen if she decides to take the tour with the expired visa? She is a US permanent resident. I'm using the beamer miniframes theme (with subsection=false) and the compress option. Currently the navigation shows the dots for each subsection side-by-side. I would prefer if there would be a horizontal space (e.g. with the width of a dot) between the dots of each subsection. Is this possible? Right now it looks like:  Section 1 oooooo  And I would prefer it to look like:  Section 1 ooo ooo  MWE: \documentclass[compress]{beamer}   \useoutertheme[subsection=false]{miniframes}   \begin{document}   \section{Sec 1}   \subsection{}   \begin{frame}[t]     hi   \end{frame} \subsection{}   \begin{frame}[t]     hi   \end{frame} \end{document}` I would like the user to have full rights on this folder (as well as all sub-directories and files in it):  ~/.blabla   currently owned by root.  I have found numerous posts (in this forum and elsewhere) on how to do this for files but I can't find a way to do it for whole folders. How do I use an NBT editor to modify item properties? In Minecraft, the NBT (Named Binary Tag) format is used to store data of our Minecraft worlds, including block, entity, and item properties. In the Java Edition of Minecraft, you can modify this data by including the data in the command, like so: /give @s diamond_sword{Enchantments:[{id:&quot;minecraft:knockback&quot;,lvl:10s}]}  In the Bedrock Edition, on the other hand, NBT is inaccessible from commands. In order to modify NBT, we need to use an external editor. What are some useful item properties that I can modify with an NBT editor, and how can I do so?  Related: Holomorphic function $\varphi$ with fixed point $z_0$ such that $\varphi'(z_o)=1$ is linear? This is an exercise in complex analysis:     Let $\Omega\subset{\Bbb C}$ be open and bounded, and $\varphi:\Omega\to\Omega$ a holomorphic function. Prove that if there exists a point $z_0\in\Omega$ such that   $$ \varphi(z_0)=z_0\qquad\text{and   }\qquad \varphi'(z_0)=1 $$   then $\varphi$ is linear.   I'm trying work out the case $z_0=0$ first, in which $$ \varphi(z)=z+\sum_{n=2}^{\infty}a_nz^2. $$ It suffices to show that $a_n=0$ for all $n\geq 2$. If let $$ \varphi(z)=z+a_2z^2+O(z^3) $$ then  $$ \varphi^k(0)=z+ka_2z^2+O(z^3), $$ and $$ \varphi^k(0)=0,\quad (\varphi^k)'(0)=1. $$ If one can show that $\{ka_2\}_{k=1}^{\infty}$ is uniformly bounded, then one at least has $a_2=0$. But I don't know how to go on. Any idea? A concrete example of involution in group theory I am reading the textbook "Introduction to Modern Algebra, Joyce 2017" and in the Cyclic groups and subgroups section, there is a following sentence about involution.     An involution $a$ is an element of a group which is its own inverse, $a^{-1} = a$. Clearly, the order of an involution $a$ is $2$ unless $a = 1$, in which case the order of $a$ is $1$.    I was trying to come up with a concrete example, but I am having difficulties. Maybe when $a = \frac{1}{2}, \frac{1}{2}^2 = 1$? I also searched the  for a concrete example, but wasn't able to find anything.  Can someone provide an example with numbers for me please? I want to understand why the author writes "clearly" that the order of an involution $a$ is $2$. Thank you