Integer part of negative numbers for continued fractions

244 Views Asked by At

In an past exam paper, one of the questions is to work out the continued fraction representaton of $-\sqrt{2}$.

I worked this out as follows:

$x_0=-\sqrt{2}$, $a_0=[-\sqrt{2}]=-1$ where $[x]$ is the integer part of $x$

$x_1=\tfrac{1}{-\sqrt{2}--1}$, $a_1=[x_1]=-2$

with $a_i=-2$ for $i\geq2$, giving the continued fraction representation as $[-1;\overline{-2}]$

This differs from the model solution as in it, he gives the integer part of $-\sqrt{2}$ as $-2$ and then the continued fraction representation as $[-2;1,1,\overline{2}]$

My question is, why did he set the interger part of $-1.41421....$ as $-2$ and not $-1$, and assuming I'm wrong, when my answer is plugged into a calculator why does it also get very close to $-\sqrt{2}$?

Thank you