can anyone please explain how 2.8 modulo 2 is 0.7999999999999998? I am not a mathematician, and just started programming in javascript and wonders how 2.8 % 2 = 0.7999999999999998.  Note: I know it is remainder operation.  May be I forgot my school mathematics concepts. Can anyone please explain this? Thanks.
In my calculator why does $\sqrt4 -2=-8.1648465955514287168521180122928e-39?$ I have tried this on my Windows 7 calculator with $\sqrt9 -3 $ it too gives some weird answer- ie$1.1546388020691628168216106791278e-37$. And so for any $n$(positive) $\sqrt n^2-n= wierd_ .answer$ Why does this happen?
Delete all files except files with the extension pdf in a directory I have a directory that contains the following:  x.pdf y.zip z.mp3 a.pdf   I want to delete all files apart from x.pdf and a.pdf. How do I do this from the terminal? There are no subdirectories so no need for any recursion. Find all the numbers $n$ such that $\frac{4n-5}{60-12n}$ can't be reduced. Find all the numbers $n$ such that $\frac{4n-5}{60-12n}$ can't be reduced.   Attempt:  $$\gcd(4n-5,60-12n)=(4n-5,-8n+55)=(4n-5,-4n+50)=(4n-5,45)$$  $$n=1: (4-5,45)=1\quad \checkmark\\ n=2: (3,45)=3\quad \times\\ n=3: (7,45)=1\quad \checkmark\\ n=4: (11,45)=1\quad \checkmark\\ n=5: (15,45)=15\quad \times\\ n=6: (19,45)=1\quad \checkmark\\ n=7: (23,45)=1\quad \checkmark\\ n=8: (27,45)=9\quad \times\\ \vdots$$ So the answer is that it can't be reduced for $n=1,3,4,6,7,..$ i.e  $$\bigg\{n\bigg|n\notin \begin{cases}a_1=2\\a_n=a_{n-1}+3\end{cases}\bigg\}$$  I want to verify that my solution is correct Is there a simple way to fill in a grungy font to make it solid? I'm looking to make the entire letter solid. I want to complete the grungy white space and fill it out with solid black. Is there a simple way to do this? How to list .txt files with specific content? How do I list all .txt files with their full path that have a word 'Ubuntu' in them. Ignore non-text files. When comparing values you should ignore the case i.e. UBUNTU or ubuNtu or UbUnTu are treated as equal to the search phrase given. $H$ is normal subgroup of $G$ iff $gHg^{-1}=H$ for every $g$ of $G$ Given the following definition of normal subgroup     A subgroup $H$ of a group $G$ is said to be normal if, for every $g\in G$: $$gH=Hg$$   I've tried to show that $H\mathrel{\unlhd} G$ if and only if we have $gHg^{-1}=H$ for every $g\in G$:  (if) Let $H\mathrel{\unlhd} G$, $g\in G$; if $l\in gHg^{-1}$, there exists $h\in H$ such that $l=ghg^{-1}$ and since $gh$ = $h'g$ for some $h'\in H$, then $l=ghg^{-1}=h'(gg^{-1}) = h'\in H$. Let $h\in H$; we can write $h$ as $hgg^{-1}$, and since $hg = gh'$ for some $h'\in H$, we obtain $h = hgg^{-1} = gh'g^{-1}\in ghg^{-1}$. So $gHg^{-1}=H$.  (only if) Let $gHg^{-1}=H$, $g\in G$; if we take an $l\in Hg$, $l = hg$ for some $h\in H$, we note immediately that $l=hg=(gh'g^{-1})g=gh'\in gH$. What should I do to show that $gH\subset Hg$?  I'm also wondering if this mess is correct, and if it is possible a more elegant proof of this fact. When to use reinterpret_cast? I am little confused with the applicability of reinterpret_cast vs static_cast. From what I have read the general rules are to use static cast when the types can be interpreted at compile time hence the word static. This is the cast the C++ compiler uses internally for implicit casts also.  reinterpret_casts are applicable in two scenarios:   convert integer types to pointer types and vice versa  convert one pointer type to another. The general idea I get is this is unportable and should be avoided.     Where I am a little confused is one usage which I need, I am calling C++ from C and the C code needs to hold on to the C++ object so basically it holds a void*. What cast should be used to convert between the void * and the Class type?  I have seen usage of both static_cast and reinterpret_cast? Though from what I have been reading it appears static is better as the cast can happen at compile time? Though it says to use reinterpret_cast to convert from one pointer type to another? Poisson Distribution of sum of two random independent variables $X$, $Y$ Produce an explicit bijection between rationals and naturals? I remember my professor in college challenging me with this question, which I failed to answer satisfactorily: I know there exists a bijection between the rational numbers and the natural numbers, but can anyone produce an explicit formula for such a bijection? Counting files in leaves of directory tree Disease transmitted by postage stamps Cannot Upgrade Xcode 11 to Xcode 11.1 I'm unable to upgrade Xcode 11GM to 11.1 for some time on my Mid 2014 MacBook Pro running macOS Catalina. I've installed Xcode from Mac AppStore ages ago (IIRC circa 2014), and upgraded step by step since then. Currently, I'm experiencing the following loop:   AppStore reports that I have an update. I open AppStore, open updates, click "Update" on Xcode. Mac Downloads ~2.5GB first. Installs that patch. Continues to get the full package (~7.6GB). It starts to install. After some churning and install, it reports "Cannot download Xcode now, please try again later."   I have more than enough space on the disk, and nothing is modified in Xcode or in the OS (no homebrew or something similar).  Did anyone experience something similar? Are there solutions to this? Use variable with TOP in select statement in SQL Server without making it dynamic How to solve the functional equation $f\left(x^2+f(y)\right)=y+f(x)^2$ How to solve the following functional equation:  Find all $f:\mathbb{R}\to\mathbb{R} $ such that: $$ f\left(x^2+f(y)\right)=y+f(x)^2 $$ Holds for every $x,y\in\mathbb{R}$.  A friend gave it to me, probably its an olympiad question.  I started with the equation $f(f(y))=y+f(0)^2$ which seems to be quite helpful, but I couldn't do it effectively. How to solve it properly? How do I install a .deb file via the command line? How do I install a .deb file via the command line? How do you convert LPCWSTR to const char *? How to set the default value of an exposed filter rather than -Any-? I have a view with exposed filters in Drupal 7 and I need to set the default value of a filter to current year. I also need to unset/remove the - Any - option from the select list. Find a tangent to two quadratic bezier curves I have two quadratic bezier curves and I want to find whether they have a common tangent, and if so where it is.  If the first bezier is defined by points $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$, then the points on the curve have coordinates:  $x = (x_1 - 2x_2 + x_3)t^2 + (2x_2 - 2x_1)t + x_1 \\ y = (y_1 - 2y_2 + y_3)t^2 + (2y_2 - 2y_1)t + y_1$  Or to simplify things:  $x = A_xt^2 + B_xt + C_x \\ y = A_yt^2 + B_yt + C_y$  Likewise, I can get an equation for the second bezier:  $x = D_xs^2 + E_xs + F_x \\ y = D_ys^2 + E_ys + F_y$  The gradient of the tangent, $m$, to the first curve at $t$ is $\dfrac{2A_yt + B_y}{2A_xt + B_x}$,  which must be equal to the tangent to the second curve at $s$, $\dfrac{2D_ys + E_y}{2D_xs + E_x}$.  So $m = \dfrac{2A_yt + B_y}{2A_xt + B_x} = \dfrac{2D_ys + E_y}{2D_xs + E_x}$  Which I rearranged to get:  $t = \dfrac{2(B_yD_x - D_yB_x)s + B_yE_x - B_xE_y}{4(A_xD_y - A_yD_x)s + 2(A_xE_y - A_yE_x)}$  The gradient of the tangent is also equal to the difference in the y-coordinates over the difference in x-coordinates:  $m = \dfrac{D_ys^2 + E_ys + F_y - (A_yt^2 + B_yt + C_y)}{D_xs^2 + E_xs + F_x - (A_xt^2 + B_xt + C_x)}$  But that's as far as I got. The algebra looks too messy from here. Can anyone solve this, or is there a better approach? How do exchanges match limit orders? Say a security has been trading at under $20.10, and there are limit orders selling at $20.10 and $20.21. Then Simon issues a limit order to buy at $20.21. According to , Simon would end up buying shares at $20.10.  Why does the exchange favor the buyer here?  I.e., why does the transaction execute at the seller's limit of $20.10 instead of the buyer's limit of $20.21?  (I.e., why don't Inara/River get to sell at $20.21 / above their limit, but Simon gets to buy at $20.10 / below his limit?)  Is the example flawed?  If it makes a difference, I'm mainly curious about NASDAQ and NYSE.  I tried Googling for specs (e.g. ), but couldn't find anything.  Only found that some  implementation executes the average of the buy/ask.  Just curious how the system works. Gift to a supportive professor? As you might have seen from my history I had a very bad advisor who deliberately underpaid me, stole my research work and undermined my career at multiple phases.  Now I am done with my university and leaving next month. A professor in my department had been very supportive of me during these times, giving me advice on how to handle this situation, gave me recommendation letters to apply for PhD programs at other universities and also got me a internship. I just want to thank her for her help. I usually would have got a champagne or something but I know she doesn't drink alcohol. Any advice? Create taxonomy terms on the fly