|
From: Raymond T. <toy...@gm...> - 2025-12-05 21:49:42
|
On 12/5/25 10:41 AM, Robert Dodier wrote: > On Fri, Dec 5, 2025 at 4:58 AM Barton Willis via Maxima-discuss > <max...@li...> wrote: >> Another thing: Although bfhalf automatically updates when fpprec changes, some special variables defined in globals.lisp do not. > I wonder if any specific bigfloat values should be functions instead > of constants, so that changing fpprec causes a different value to be > returned. Or maybe baking the prevailing fpprec into the symbol name, > something like BIGFLOAT-%PI-FOR-DEFAULT-FPPREC or whatever. I agree on adding functions. We already have `fppi` that returns a bigfloat pi for the current fpprec. But `fppi` returns a bfloat object sans bfloat marker. And `fppi` is memoized. I think if you use the bigfloat package, you get `(bigfloat:%pi num)` where `num` is only used to figure out what kind of result to return (single, double, big float). Similarly for `bigfloat:%e`. > > Speaking strictly for myself, I can't keep it straight in my head when > some constant is no longer valid in some context ... if developers are > supposed to "just know", then it's likely that I'll mess it up at some > point. YMMV as always. I don't think it's just you. |