Re: pi seems not to be a constant

"Pascal J. Bourguignon" <[email protected]>
Newsgroups gmane.lisp.clisp.general
Organization Informatimago
Message-ID <[email protected]>

On 16/10/15 09:21, Don Cohen wrote:
> [1]> (lisp-implementation-version) ; built from current source
> "2.49+ (2010-07-17) (built 3653902709) (memory 3653902846)"
> [2]> (constantp 'pi) ; I think this should return T
> NIL
> [3]> (defconstant pi2 pi)
> PI2
> [4]> (constantp 'pi2)
> T
> [5]>
>

The problem is that in clisp, CL:PI is not constant


[1]> pi
3.1415926535897932385L0
[2]> (setf (ext:long-float-digits) 1000)
1000
[3]> pi
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587L0 

[4]>

Conformity could be restored by having CL:PI defined as a constant 
variable bound to double-float π, and to have another variable EXT:PI 
bound to the changing long-float π value.

-- 
__Pascal J. Bourguignon__
http://www.informatimago.com/


------------------------------------------------------------------------------
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.