Igor Sobrado wrote:
I have tested these base 11 to base 10 translations on other bc
versions and all show the same behaviour.  I agree, this behaviour
is historically consistent.  But this handling of non-decimal
fractions is wrong from the point of view of mathematics.  In other
words:

 - 0.1 produces 0, but should return .1
 - 0.10 produces .09, it is right
 - 0.100 produces .090, but should return .091
 - 0.1000 produces 0.0909, it is ok too
 - 0.10000 produces 0.09090, but should return 0.09091 instead...

A mathematician would say that this behaviour is wrong and must be
fixed even if it is historically right.  As a physics graduate and
Ph.D. is CS I agree with mathematicians too.  But there are some
questions that must be answered:

 - will fixing this *wrong* behaviour break compatibility with other
   bc implementations? -- how many scripts will break then?
 - how will a fix for this issue affect performance of bc?
 - will it be difficult to implement?

I am certainly against a "compatibility" option... what would be the
default behaviour for bc?  The right one or the wrong one?

In short, would it make sense fixing this bug even if it means
releasing an incompatible bc flavour?

As the original poster observed, this bug seriously affects other
calculations done with bc.  If SU does not say anything about how
non-decimal fractions must be handled I would choose the right
approach from a mathematical sense.  Of course, I am thinking that
"if SU says nothing about this fact, it means that we are free to
choose how non-decimal numbers must be managed".  Perhaps it is
wrong, but increasing precision on bc makes sense to me.


I want to be hoonest, I am not involved in bc problems, but reading these mails, just as an idea:

Why not creating a new bc, or in other words changing the bc of today and correcting that math stuff. Name the new, corrected bc something like bc2.

Everybody wanting to keep (for any reasons) the old one may call bc at the prompt or in scripts.

Everybody wanting the new, corrected bc may call bc2 at the prompt or in scripts.

Everybody saying "I don4t care" (for any reasons) may symlink bc2 getting it as bc.


What about going that way??


--
Michael Schmidt     MIRRORS:
DJGPP               ftp://ftp.fh-koblenz.de/pub/CompilerTools/DJGPP/
Watcom              ftp://ftp.fh-koblenz.de/pub/CompilerTools/Watcom/
OpenOffice          ftp://ftp.fh-koblenz.de/pub/OpenOffice/

Reply via email to