标签: lisp scheme
我正在使用MIT / GNU Scheme。如果我计算两个整数的商并且商是浮点数,则输出不是浮点数,而是两个数字的表达式,如: 12222222222222232/2344444444412 。如何获得浮点格式输出?
答案 0 :(得分:3)
使用exact->inexact功能:
exact->inexact
(let ((x (/ 5 7))) (let ((f (exact->inexact x))) (display f)))