123456789101112131415161718192021222324252627282930313233343536 | '\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Num.is_rational 3 2026-08-27 "Tomo man-pages"
.SH NAME
Num.is_rational \- whether a number is a fraction
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Num.is_rational\ :\ func(n:\ Num\ ->\ Bool)
.fi
.SH DESCRIPTION
Whether a number can be written exactly as a fraction, as opposed to an irrational value like the square root of two.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx
l l l.
Name Type Description
n Num The number to check.
.TE
.SH RETURN
`yes` if `n` is rational.
.SH EXAMPLES
.EX
assert (1./3.).is_rational()
assert not (2.).sqrt()!.is_rational()
.EE
.SH SEE ALSO
.BR Tomo-Num (3)
|