On Sat, Jul 27, 2024 at 05:25:52PM +0200, Grégory Vanuxem wrote:
> No. toString(3.7,20)

I see.  Yes we need 'floor' but also a special case for negative
numbers.  And there are nasty bordeline cases, for example when
number is smaller than the next integer but the difference is
smaller than resolution of the convertion.  Arguably in such
case we should round up.

To say the truth we probably do not want separate implementation
of 'toString', issues are exactly the same as in printing code
and solution is likely to be the same.


> Le sam. 27 juil. 2024 à 17:24, Waldek Hebisch <de...@fricas.org> a écrit :
> >
> > On Sat, Jul 27, 2024 at 03:31:57PM +0200, Grégory Vanuxem wrote:
> > > =>
> > > (1)  "4.30000000000000000000"
> > >
> > > I wanted to use it, but apparently not now ;)
> >
> > Hmm, what do you want?
> >
> > (17) -> toString(4.3)
> >
> >    (17)  "4.3"
> >                                                                  Type: 
> > String
> >
> > (18) -> toString(4.3, 20)
> >
> >    (18)  "4.30000000000000000001"
> >                                                                  Type: 
> > String
> >
> > Do you want 20 digits (or whatever you specified) or not?
> >
> > --
> >                               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 fricas-devel+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/fricas-devel/ZqURL1sqf06As1_Y%40fricas.org.
> 
> -- 
> 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 fricas-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/fricas-devel/CAHnU2dZjJO%2BaUm4G4OnChy_gLmsA-fwipoBUpzarcYhBLJPAmA%40mail.gmail.com.

-- 
                              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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/ZqUtB5VViBKi9f-D%40fricas.org.

Reply via email to