[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help needed; Number and Precision Problem



L66@psuvm.psu.edu writes:
> Hi, Netters. I need your help. I am using MCL 1.3.2.
> My question is how can I save just two digits after decimal point.
> (float 1/3) returns 0.3333333333333. However, I want keep just 0.33 instead of
> whole precision. (float (/ num1 num2)) ===> x.xx is the form I want.
> Any help will be welcomed. Many thanks in advance. L66@psuvm.psu.edu

Try something along the lines of:

	(/ (fround (* 1/3 100)) 100)

-William Lott
CMU Common Lisp Group