On Wed, Aug 07, 2024 at 04:14:45AM +0200, Grégory Vanuxem wrote:
> 
> I guessed it has to be applied on the extracted FLOAT.spad file during
> the build.

Alternatively you can just apply it to float.spad and do

)compile float.spad

> It works fine thanks but is this expected:
> 
> Before and after
> 
> (1) -> toString(3.7,30)
> 
>    (1)  "3.700000000000000000002684354560"
> 
>                            Type: String
> 
>              Time: 0.04 (OT) = 0.06 sec
> (2) -> )lib FLOAT
>    Float is now explicitly exposed in frame frame1
>    Float will be automatically loaded when needed from
> /home/greg/Git/jlfricas/FLOAT.NRLIB/FLOAT
> (2) -> toString(3.7,30)
> 
>    (2)  "3.700000000000000000002710505431"
> 
>                            Type: String

AFAICS 3.700000000000000000002710505431 is correct.  The other
result is due to rounding error:

(65) -> digits()

   (65)  20
                                                        Type: PositiveInteger
(66) -> a := 3.7

   (66)  3.7
                                                                  Type: Float
(67) -> digits(30)

   (67)  20
                                                        Type: PositiveInteger
(68) -> a - 3.700000000000000000002710505431

   (68)  0.0
                                                                  Type: Float
(69) -> a - 3.700000000000000000002684354560

   (69)  0.261509 E -22
                                                                  Type: Float

Code in FLOAT.spad in not perfect but is _much_ better than old
implementation of 'toString'.

-- 
                              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/ZrNYK9CjEoR-S6i-%40fricas.org.

Reply via email to