I am writing a program that handles numbers as large as 10 ** 100, everything looks good when dealing with smaller numbers but when values get big I get these kind of problems:  &gt;&gt;&gt; N = 615839386751705599129552248800733595745824820450766179696019084949158872160074326065170966642688 &gt;&gt;&gt; ((N + 63453534345) / sqrt(2)) == (N / sqrt(2)) &gt;&gt;&gt; True   Clearly the above comparision is false, why is this happening?  Program code:  from math import *  def rec (n):     r = sqrt (2)     s = r + 2     m = int (floor (n * r))     j = int (floor (m / s))     if j &lt;= 1:         return sum ([floor (r * i) for i in range (1, n + 1)])     assert m &gt;= s * j and j &gt; 1, "Error: something went wrong"     return m * (m + 1) / 2 - j * (j + 1) - rec (j)  print rec (1e100)   Edit:  I don't think my question is a duplicate of the linked question above because the decimal points in n, m and j are not important to me and I am looking for a solution to avoid this precision issue.
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
FTP File Upload with HTTP Proxy Is there a way to upload a file to a FTP server when behind an HTTP proxy ?  It seems that uploading a file is not supported behind an HTTP Proxy using .Net Webclient. ().  If there is no workaround ? If not, do you know a good and free FTP library I can use ?  Edit: Unfortunately, I don't have any FTP proxy to connect to. I need to calculate the time complexity of the following code:  for (i = 1; i &lt;= n; i++) {   for(j = 1; j &lt;= i; j++)   {    // Some code   } }   Is it O(n^2)? Multiple tags search broken when searching as anonymous user? When I input [asdf][lisp] into the search field on , without being logged in, only one tag remains. Is it broken? How to compare dates in Java? Is it necessary to use commas in lists before the conjunction? I have seen many sentences like this:     "Capitalism, Socialism, and Anarchism"   and this:     "She was happy, and cheerful"   Do we have to use a comma before "and", or is it incorrect?  If it is not, then why? Let $G$ be a finite group and $N$ a normal subgroup of $G$ of index $4$. Prove that $G$ has a subgroup of index $2$ (hence normal) and if $G/H$ is not cyclic then $G$ is equal to the union of three proper subgroups.   I understand that $G/H$ is isomorphic to $\mathbb{Z}_4$ or $\mathbb{Z}_2\times \mathbb{Z}_2$. Let $K^*$ be a subgroup of $G/H$ of order $2$. Then $K^*\cong K/H$ for some $K$ such that $H$ is normal in $K$ and hence $[G:K]=[G/H:K/H]=4/2=2$.  If $G/H$ is not cyclic then $G/H\cong \mathbb{Z}_2\times \mathbb{Z}_2$. I don't know how to prove $G$ is the union of three subgroups. Could it be true that as $G/H$ is the union of three proper subgroups $K_1^*,K_2^*,K_3^*$ then the corresponding groups $K_1,K_2,K_3$ have union equal to $G$? Would anyone give me a hint to prove this?  Thank you. I have an array of integers, how do I use each one in a mysql query (in php)? How to list files in a zip without extra information in command line In my bash command line, when I use unzip -l test.zip I get the output like this:  Archive:  test.zip   Length      Date    Time    Name ---------  ---------- -----   ----    810000  05-07-2014 15:09   file1.txt    810000  05-07-2014 15:09   file2.txt    810000  05-07-2014 15:09   file3.txt ---------                     -------   2430000                     3 files   But I am interested only by the lines containing the file details.  I tried to make filtering using grep like this:   unzip -l test.zip | grep -v Length | grep -v "\-\-\-\-" | g -v Archive | grep -v " files"  But it is long and prone to error (e.g a file name Archive in this list will be dropped)  Is there any other options with unzip -l (I checked the unzip man page and did not find any) or another tool to do so?  It is important to me to not really unzip the archive but just to look what files are inside. How To Set Default Wallpaper As Login Screen Wallpaper [Automatically]? Calculating $\lim_{x\to0} \left\lfloor\frac{x^2}{\sin x \tan x}\right\rfloor$ Find $$\lim_{x\to0}  \left\lfloor\frac{x^2}{\sin x \tan x}\right\rfloor$$ where $\lfloor\cdot\rfloor$ is greatest integer function   I am a high school teacher. One of my students came up to ask this limit.  For $\lfloor\frac{\sin x}{x}\rfloor$, I have used $\sin x &gt; x$ using increasing decreasing functions.  I tried to prove $x^2 &gt; \sin x \tan x$ using increasing /decreasing  function but I am not getting it. Regex for quoted string with escaping quotes How do I get the substring " It's big \"problem  " using a regular expression?  s = ' function(){  return " It\'s big \"problem  ";  }'; Inverse of a Positive Definite Why does my Nikon D3100 give the error "Lens not attached" with a Vivitar 200 telephoto lens? problems using apa6e with biblatex-apa As in  I'm trying to use apa6e and biblatex-apa together and having problems.  Before I arrived at these problems, over the course of many hours of much reading, I first managed to get BibTeX working as expected in a simple input file (by modifying sample2e.tex). Then I managed to get apa6e working as expected based on the author's example in apa6e.pdf (which uses apacite). But when I try to get apa6e working with biblatex-apa, I end up with problems.  Here's my input file:  \documentclass{apa6e}  \usepackage[american]{babel} \usepackage{csquotes}  % biblatex \usepackage[style=apa]{biblatex} \bibliography{biblatex-apa-test-references}  \title{An Example Document} \shorttitle{Psychology: the end} \author{Silly Name}  \authornote{\dots} \abstract{\dots}  \begin{document}  \maketitle  This is an example input\cite{7.01:2} file.  Comparing it with the output it generates can show you\cite{7.01:3a} how to produce a simple document of your own.  \printbibliography  \end{document}   Attempting to typeset this in TeXShop by running LaTeX, then BiBTeX (which based on console messages, does seem to correctly call biblatex rather than BiBTeX), then LaTeX again, I get the following error message which I am having great difficulty (no doubt due to my lack of experience with TeX and co.) decoding.  (./test6.aux) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/ot1ptm.fd) *geometry* driver: auto-detecting *geometry* detected driver: pdftex (./test6.bbl) Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 An Ex-am-ple Doc-u-ment   Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 Silly Name   Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 Author Note  [1{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 Abstract  [2] Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 An Ex-am-ple Doc-u-ment   Underfull \hbox (badness 10000) in paragraph at lines 25--25  []\OT1/ptm/b/n/12 References  ./test6.tex:25: Undefined control sequence. &lt;argument&gt; \mkbibdateapalongextra  (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/ot1pcr.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/ot1ztmcm.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/omlztmcm.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/omsztmcm.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/omxztmcm.fd) Overfull \hbox (8.03372pt too wide) in paragraph at lines 25--25 [][]  \OT1/ptm/m/n/12 Gilbert, D. G., Mc-Cler-non, J. F., Ra-bi-novich, N. E.,  Sugai, C., Plath, L. C., As-gaard, G., ... Botros,  ./test6.tex:25: Undefined control sequence. &lt;argument&gt; \mkbibdateapalongextra                                    {year}{month}{day}\iffieldundef {endyear}{... l.25   I tried many different sources in several different *.bib files before eventually trying the .bib database shown above and included with biblatex-apa. All trials gave a similar error.  Can someone help? I'm impressed that the poster above was able to do anything with apa6e and biblatex-apa, and if I only had her problem of having the reference page title show up in bold, I'd be really happy.  If you need to know, my tools are from a fresh installation of MacTeX that I immediately updated using the TeX Live Utility. I've checked my versions for apa6e (v0.3) and biblatex-apa (v4.2), and I think these are current. How Do I insert a image in LaTex from my computer How do I create a file in windows from where LaTex can extract the pdf or Jpg file I want to insert in my document? In other words I need an example of inserting either images or pdf files in my document Here's the image I want to insert    The Image will be placed center to the page just beneath this codes  \[ \overline \rho = \overline P + 0.645 \Big (\frac { \overline P}{K}\Big) ^{\frac {3}{4}} \tag { Tazkera} \] How do you tell what brand/make/model of bike I have? I have a bike I'm trying to sell because it's just been sitting in my basement. It looks as if someone primered it and the only thing I found was a serial number. Is there like a website I can look up more info on the bike using just that number? Can an irrational number raised to an irrational power be rational? In my family we have a DNA contradiction – two cousins (at about the 4th cousin level) took a Y-DNA test, but did not match and had two completely different haplogroups.   Since then, I have traced living cousins with the same surname – the only ones left living that I am aware of – and I would love to pay to have them tested to see if we can figure out where the non-paternity event (NPE) or other event happened (i.e. this new cousin could help us determine which line the NPE occurred in depending on which cousin he matches).   Does anyone have a sample letter, or know the best way to go about asking a distant cousin for DNA?   I have their address and am planning to write a letter, but I can't imagine receiving such a letter, so I am not quite sure how to ask without scaring them off. Tools to measure the nonrandomness of database I was working on historical data looking for anomalous patterns that we would not expect to occur at random. I'd like to create a scheme to analyze data and markets to test for statistical significance and consistency over time.  Question : Are there some tools we could use to evaluate the nonrandomness of a database? What do we use usually to say that something is random or not (statistically)? Figure we work with change in some value over time. Replace links with the current question title in comments In questions, links get converted into question titles (see )  Can the same functionality be added to comments?