公告
财富商城
积分规则
提问
发文
2019-06-21 05:17发布
欢心
When I do (floor 4 3) I got
1 1/3
But how do I use that 1/3?
You can for instance bind it to a variable using multiple-value-bind.
multiple-value-bind
(multiple-value-bind (quot rem) (floor 4 3) (format t "The remainder is ~f~%" rem))
Another possibility, if you're only interested in one non-primary value, is nth-value.
nth-value
(format t "The remainder is also ~f~%" (nth-value 1 (floor 4 3)))
For reference, see the Hyperspec.
最多设置5个标签!
You can for instance bind it to a variable using
multiple-value-bind
.Another possibility, if you're only interested in one non-primary value, is
nth-value
.For reference, see the Hyperspec.