[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
precision vs more information
If you go from a floating point number to a ratio you lose information,
the information that the number is an approximation. Exactly how
much of an approximation is hard to tell of course because it depends
on the computational history of the quantity. But the fact that it is
a floating point number can be dangerous information to loose so easily.
This about this:
(defun s (t)
(* 1/2 g (^ t 2)))
The 1/2 has been introduced do to a process of symbolic integration.
Why should it affect the form of the answer to a formula?
Returning a floating point number tells you that the result might
not be the right answer. But with rational arithmetic you can be
sure of getting simply meaningful mathematic results from your
formuli.