Re: pi seems not to be a constant
Pierpaolo Bernardi <[email protected]>
| Newsgroups | gmane.lisp.clisp.general |
|---|---|
| Message-ID | <CANY8u7EDQRkAs6tN9Ub4xmdkjZvbJ45PXaBeNu0mNrZcOb8Nuw@mail.gmail.com> |
On Tue, Oct 20, 2015 at 1:25 AM, Don Cohen <[email protected]> wrote: > Pierpaolo Bernardi writes: > > On Tue, Oct 20, 2015 at 12:28 AM, Don Cohen > > <[email protected]> wrote: > > > Pierpaolo Bernardi writes: > > > > A typical use case for adjustable precision floats is the following: > > > > > > > > (setf (ext:long-float-digits) some-appropriate-number-of-bits) > > > > (large-body-of-standard-portable-cl-code-using-long-floats) > > > > > > > > If long-float-digits is changed and the "constants" are not adjusted > > > > then STANDARD PORTABLE CL code will break. > > > > > > I don't understand what you think will go wrong. > > > Please specify. > > > > Portable, standard, CL code expects the value of > > MOST-POSITIVE-LONG-FLOAT to be the most positive long float value. > > I already demonstrated that this expectation is violated in clisp > as things are right now. > > I didn't actually propose to "fix" that. > I'd rather "fix" the expectations of users/programmers who set > long-float-digits. > > > With your proposal, the example case I described above won't work. > > Your code above does not demonstrate this. I was asking for such a > demonstration. How about a demonstration of some code that might > be useful for something other than demonstrating non-compliance? Here it is: ;; portable CL code library (defun circle-area (radius) (* radius radius pi)) currently in Clisp I can use the above code in this way: (setf (ext:long-float-digits) 1000) ;; print area with 1000 bits precision (print (circle-area 42l0)) This will break under your proposal. I think this is an important use case and I will be unhappy if this stopped working. If you don't agree that this is a useful feature of Clisp, then we will have to agree to disagree. Cheers P. ------------------------------------------------------------------------------ _______________________________________________ clisp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-list