Floating Point Precision Error
问题 I am having problem with the LISP expression below. There is floating precision error while doing sum for floating point numbers. CL-USER> (+ -380 -158.27 -35.52) Actual: -573.79004 Expected: -573.79000 Please suggest me how can I achieve the expected result in LISP (I am using Lispworks). 回答1: Floats are not exact Floats represent a subset of mathematical reals with certain precision , they are not exact numbers. Round off errors are inevitable . The ANSI Common Lisp standard provides for 4(