当我这样做(4楼3号)我得到了
1
1/3
Run Code Online (Sandbox Code Playgroud)
但是我如何使用1/3呢?
Ped*_*erg 18
例如,您可以使用将其绑定到变量multiple-value-bind.
(multiple-value-bind (quot rem)
(floor 4 3)
(format t "The remainder is ~f~%" rem))
Run Code Online (Sandbox Code Playgroud)
如果你只对一个非主要价值感兴趣,另一种可能性是nth-value.
(format t "The remainder is also ~f~%" (nth-value 1 (floor 4 3)))
Run Code Online (Sandbox Code Playgroud)
有关参考,请参阅Hyperspec.