On Sat, Mar 30, 2024 at 12:55:58AM +0100, Grégory Vanuxem wrote:
> Hello,
>
> I don't think this is intended, or at least it's not documented in HyperDoc:
>
> (1) -> float(17,1) -- 17 * base() ^ 1
>
> (1) 0.3 E 2
> Type: Float
> (2) -> log %
>
> (2) 3.5263605246_161613897
> Type: Float
> (3) -> log(34.0)
>
> (3) 3.5263605246_161613897
> Type: Float
AFAICS it is intended:
1) float(17, 1) creates number with specified internal representation,
2) number of mantissa bits is taken as accuracy
3) when number is expressed in exponential way, then it is printed
in exponential form in base 10
Those rules determine output in (1). In principle printing routine
could include second digit after dot, that is print with more accuracy
than internal "accuracy", but I think that decision to print only
digits justified by accuracy is intentional.
When exponent is zero situation is a bit different and in this
case number can be printed exactly.
BTW: Compare:
(8) -> PRETTYPRINT(float(17,1))$Lisp
(17 . 1)
(8) ()
Type: SExpression
(9) -> PRETTYPRINT(34.0)$Lisp
(34 . 0)
(9) ()
Type: SExpression
You can see that internal representation is quite different.
--
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/ZghPP5jkxIDn7cDo%40fricas.org.