On Sun, Jul 28, 2024 at 10:09:15AM +0200, Ralf Hemmecke wrote:
> > 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.
> 
> Isn't that easy to solve by adding (or subtracting if the number is
> negative) half of the precision (i.e. basically rounding the part after the
> dot)?
> 
> In fact, "round" is probably correct, but it should be round(10^n*x)/10^n
> and then do the splitting.

Well, that would work in exact artithmetic.  But the code tries to
work in floating point and this is source of nasty troubles.  Also
"normal" rounding mode for pinthing purpoose should be "round to nearest,
even", which is more complicated than simple 'round'.

-- 
                              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/ZqYg-wZwDpwrywkM%40fricas.org.

Reply via email to