.\"******************************************************************* .\" .\" This file was extracted from hal/components/near.comp using halcompile.g. .\" Modify the source file. .\" .\"******************************************************************* .TH NEAR "9" "2024-03-13" "LinuxCNC Documentation" "HAL Component" .SH NAME near \- Determine whether two values are roughly equal. .SH SYNOPSIS .HP .B loadrt near [count=\fIN\fB|names=\fIname1\fB[,\fIname2...\fB]] .SH FUNCTIONS .TP \fBnear.\fIN\fB\fR (requires a floating-point thread) .SH PINS .TP .B near.\fIN\fB.in1\fR float in \fR .br .ns .TP .B near.\fIN\fB.in2\fR float in \fR .br .ns .TP .B near.\fIN\fB.out\fR bit out \fR \fBout\fR is true if \fBin1\fR and \fBin2\fR are within a factor of \fBscale\fR (i.e., for in1 positive, in1/scale <= in2 <= in1*scale), OR if their absolute difference is no greater than \fBdifference\fR (i.e., |in1-in2| <= difference). \fBout\fR is false otherwise. .SH PARAMETERS .TP .B near.\fIN\fB.scale\fR float rw \fR(default: \fI1\fR) .br .ns .TP .B near.\fIN\fB.difference\fR float rw \fR(default: \fI0\fR) .SH AUTHOR Chris Radek .SH LICENSE GPL