llm
Download
40 lines 1.1 KiBGroffModified 2026-08-27 raw
12345678910111213141516171819202122232425262728293031323334353637383940
'\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Float64.near 3 2026-08-27 "Tomo man-pages"
.SH NAME
Float64.near \- check if two numbers are near each other
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Float64.near\ :\ func(x:\ Float64,\ y:\ Float64,\ ratio:\ Float64\ =\ 1e-9,\ min_epsilon:\ Float64\ =\ 1e-9\ ->\ Bool)
.fi
.SH DESCRIPTION
Checks if two numbers are approximately equal within specified tolerances. If two numbers are within an absolute difference or the ratio between the two is small enough, they are considered near each other.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
x	Float64	The first number. 	-
y	Float64	The second number. 	-
ratio	Float64	The relative tolerance. Default is \fB1e-9\fR. 	1e-9
min_epsilon	Float64	The absolute tolerance. Default is \fB1e-9\fR. 	1e-9
.TE
.SH RETURN
`yes` if `x` and `y` are approximately equal within the specified tolerances, `no` otherwise.

.SH EXAMPLES
.EX
assert Float64(1.0).near(1.000000001)
assert Float64(100.0).near(110, ratio=0.1)
assert Float64(5.0).near(5.1, min_epsilon=0.1)
.EE
.SH SEE ALSO
.BR Tomo-Float64 (3)