>>>>> "Mario" == Mario Rodriguez <biomates at telefonica.net> writes:
>> > In the gcl I am using, I get
>> >
>> > >(sin (* 7.25 pi))
>> >
>> > -0.70710678118654757
>>
>> GCL's result above is correct (to many digits).
Mario> I think the problem is specific to clisp when using double precision in
Mario> some cases:
Mario> In clisp:
Mario> [1]> (sin (* pi 7.25))
Mario> -0.7071066 <- correct
Mario> [2]> (sin (* pi 7.25d0))
Mario> 0.0d0 <- incorrect
Mario> [3]> (sin (* pi 7.251d0))
Mario> -0.709324729572275d0 <- correct
Mario> [4]> (sin (* pi 7.249d0))
Mario> -0.7048818539423602d0 <- correct
According to ANSI CL, these are all wrong. The results are supposed
to be long-float's since pi is a long-float on Clisp. Setting
*floating-point-contagion-ansi* to T gives ANSI CL behavior. (Maxima
sets this to T anyway.)
Nevertheless, there is a bug in clisp:
(sin (coerce (* pi 7.25d0) 'double-float)) -> 0d0
Ray