|
From: Raymond T. <toy...@gm...> - 2025-12-07 00:30:35
|
In a discussion with Barton and Stavros, it came up that ecl was getting some type errors in running the testsuite. In particular, |elliptic_e| and |lambert_w| were producing long-float values. In maxima, float values are always supposed to be double-floats. However, in ecl and clisp, |cl:pi| is a long-float because both ecl and clisp have a long-float type separate from double-float. This means any code that uses |cl:pi| causes the use of long-floats. That's not want we want to happen. I'm not sure what the best solution is, but we do have |bigfloat:%pi| to return a value of pi of the appropriate type. However, that's a method so there's some cost to using this. I'm not sure if a compiler macro could be written to remove the cost. An alternative is to change |bigfloat:%pi| to be a function. Then I can definitely write a compiler macro to return the appropriate type if the arg has a known value. A quick grep shows that currently |bigfloat:%pi| is always called with a variable instead of a constant. There are also quite a few places where we do |(coerce pi 'flonum)| and |(float pi 1e0)|. These should be updated to use |bigfloat:%pi| if we choose to do this. This might be ok. I'll do some experimentation. ​ |