parse-float
parse-float copied to clipboard
Add randomized tests
It's possible to do more comprehensive testing with randomized tests. Something like
(let ((r (random most-positive-double-float)))
(= r (parse-float:parse-float (prin1-to-string r) :type 'double-float
:exponent-character #\d)))
Nice idea.
Do you now if random states are the same across all platforms? I would hate it if test 213 fails on one computer and I cannot reproduce it on mine.
Random states are definitely not portable, unfortunately.
For single floats, we may opt to just test them all. Why not?