Is there a simple way to return the fractional part of a number in common lisp?
At the moment I am using
Code: Select all
(multiple-value-call (lambda (x y)(declare (ignore x)) y) (floor 1.5))
Code: Select all
(multiple-value-call (lambda (x y)(declare (ignore x)) y) (floor 1.5))
Code: Select all
(mod 1.5 1)
FWIW, (nth-value 1 (floor 1.5))stackman wrote:Hi,
Is there a simple way to return the fractional part of a number in common lisp?
At the moment I am usingbut this seems a bit verbose.Code: Select all
(multiple-value-call (lambda (x y)(declare (ignore x)) y) (floor 1.5))