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