Nfix
Coerce to a natural number
Nfix simply returns any natural number argument unchanged,
returning 0 on an argument that is not a natural number. Also see ifix, see rfix, see realfix, and see fix for analogous
functions that coerce to an integer, a rational number, a real, and a number,
respectively.
Nfix has a guard of t.
Function: nfix
(defun nfix (x)
(declare (xargs :guard t))
(if (and (integerp x) (>= x 0)) x 0))
Subtopics
- Std/basic/nfix
- Rules about nfix.