On Sun, Apr 07, 2024 at 06:05:39AM +0200, Grégory Vanuxem wrote:
> Hello,
>
> I was trying to return the previous setting instead of Void for the
> different outputting routines in Float (outputFixed, outputGeneral and
> outputFloating), so I looked more carefully at this issue.
>
> Issue #159 => https://github.com/fricas/fricas/issues/159
>
> Basically, and more spectacularly that what was expressed in the issue #159:
>
> (1) -> float(17,-1)
> (1) 9.0
> (2) -> %*2
> (2) 17.0
> (3) -> float(17,-1,2)
> (3) 8.5
>
> Adding PRINT()$Lisp to the two 'float' routines (two or three args) I
> saw the difference that leads to this:
>
> (27) -> float(17,-1)
> (17 . -1)
> (27) 9.0
> (28) -> float(17,-1,2)
> (156797324626531188736 . -64)
> (28) 8.5
>
> And to coerce the Float to OutputForm convert(Float)@String is used.
> But with default settings the bits(n)$Float routine is used to change
> the precision in bits before performing the transformation to a string
> and it uses the mantissa which is for 8.5 (17 . -1) only 5 bits So
> when internal output routines do the string coercion digits() returns
> 1, this explains the rounding done above:
<snip>
> I do not know how that should be solved
I am not sure what do you want to solve? Suppose that 'float(a, b)'
was purely internal and unavailable to users. Would you consider
behaviour of other functions to be a bug?
> Another point:
>
> It is possible to modify some parameters to Float output routines,
> what about returning the previous settings? For example
> outputSpacing(n) returns Void but if you want to temporarily modify
> this setting, in Spad for example, reverting to the user setting is
> not possible. I attached a proof of concept patch that implements
> this. In fact, even the macro 'separator ==> underscore()$Character'
> could also be parametrable, it is not in this diff though.
Such change looks desirable. I will apply the patch after fixing
a few formatting issues.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/Zhn5JxvJsIZNXhjB%40fricas.org.