# Representing zero as a rational number

How to represent 0 as rational number?

$0/0$ is not legitimate, $0/\text{const}$ should be good enough, but what is the right value of const? $0/1$ works for a lot of computational cases, but only on intuitive.

• $\frac{0}{a}=0$ for any $a\neq 0$, and a number doesn't need to be represented in some way to be a rational number. $0\in\mathbb{Q}$ since $0\in\mathbb{N}$, for instance. Feb 25, 2018 at 12:01
• Rational numbers are equivalence classes of pairs of integers, so the class of $(0, k)$ suffices for any integer $k \neq 0$ Feb 25, 2018 at 12:01
• "In mathematics, a rational number is any number that can be expressed [i.e. represented] as the quotient or fraction $\dfrac p q$ of two integers, a numerator $p$ and a non-zero denominator $q$. Since $q$ may be equal to $1$, every integer is a rational number. " Feb 25, 2018 at 12:01
• And I thought that $0/1$ equalled $0$; not just that it works for a lot of computational cases. I can't imagine a "computational case" where it didn't work. Feb 25, 2018 at 12:09
• 0 is a rational number. Why do you want to write it any other way? Feb 25, 2018 at 12:32

There is no single right value. The rational number $0$ can be represented as the quotient of an integer by a non-zero integer in infinitely many ways: $0=\frac 0d$ ($d\in\mathbb{Z}\setminus\{0\}$). Choosing $d=1$ is a natural choice: every rational number can be represented in one and only one way as $\frac nd$ with $n\in\mathbb Z$, $d\in\mathbb N$ and $\gcd(n,d)=1$. In the case of $0$, that representation is $\frac01$.

• There is no "right" value? Or there is no "single right" value? Feb 25, 2018 at 22:32
• @RandallStewart I've edited my answer. Thank you. Feb 25, 2018 at 22:54
• Hello! This question (which in my opinion is a sincere inquiry) is at risk of deletion. The problem is that the linked duplicates are bad as JMoravitz and I agreed, but this wasn't the asker's fault, so could you please edit the duplicate list to add the two links JMoravitz gave in a comment under the question and remove the original, so that it is reasonably justifiable to keep the question (closed as duplicate rather than deleted)? Thanks! Aug 13, 2021 at 10:50
• @user21820 Done. Aug 13, 2021 at 11:05
• Thank you very much! Aug 13, 2021 at 11:19

What is wrong with $$\cdots=\frac{0}{-2}=\frac{0}{-1}=0=\frac{0}{1}=\frac{0}{2}=\frac{0}{3}=\cdots \ ?$$ You have an infinity of perfectly defined representations...

• Yes. And in fact for other rationals you also have infinitely many representations. $$\dots =\frac{-14}{-4} = \frac{-7}{-2} = \frac{7}{2} = \frac{14}{4}=\dots$$ Feb 25, 2018 at 12:30
• $$\frac{0}{-6} = \frac{-6}{-6} * \frac{0}{1}$$
– Rob
Feb 25, 2018 at 18:02

$0/1$ is generally considered to be the canonical form. This is important for the definition of the "rational ruler" or modified Dirichlet function:

$$f(x) = \begin{cases} 0 & x \in \Bbb{R}\setminus\Bbb{Q} \\ 1/q & x = p/q \mbox{ in lowest terms}\end{cases}$$

and I'm sure in many other situations too.

• If you're referring to Thomae's function, that actually takes the value $1/q$ instead of $q$ for rational $x$. But a nice example nonetheless. Feb 25, 2018 at 15:16
• Yes, good catch! Feb 25, 2018 at 15:22

As other answers have mentioned, there are many equivalent representations of $0$ in the rational numbers.

A formal way to define rational numbers is the following:

Consider the set - $$S = \{ (x,y) \in \textbf{Z} \times \textbf{Z} \quad |\quad y \neq 0\} .$$

The each element $q$ of the rational numbers Q is an equivalence class $\bar{s} \in S/\equiv_{\sim}$ under the equivalence relation: $$(a,b)\sim (c,d) \iff ad = bc$$ Or equivalently in Q: $$ad = bc\iff \frac{a}{b}= \frac{c}{d}$$ Since $0 \cdot b = 0 \cdot d = 0$ for any $d, c \in \textbf{Z}$, we can represent $0 \in \textbf{Q}$ as $(0,x)$ for any $x \in \textbf{Z}-\{0\}$.

You can do this procedure for any integral domain $R$, and it represents the field of fractions of $R$, denoted commonly as $Quot(R)$.