Package: bc
Version: 1.06.95-4
Severity: normal

Dear Maintainer,

The following example illustrates the problem:

        ~$ bc -l
        bc 1.06.95
        Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software
        Foundation, Inc.
        This is free software with ABSOLUTELY NO WARRANTY.
        For details type `warranty'. 
        e(l(-1))
        Runtime warning (func=e, adr=123): scale too large, set to 2147483647
        Fatal error: Out of memory for malloc.

I would have expected the l(-1) to cause a runtime error, since bc does
not support complex numbers.  Part of the issue appears to be that l(-1)
produces the incorrect output -99999999999999999999.  The bc calculator
then tries to exponentiate that large negative value and apparently fails
miserably for the task.

In summary, I would expect that:

(1) A domain error (e.g. an attempt to compute a logarithm from a
negative number) to be reported as such instead of bc producing invalid
output.

(2) The result of "e(-99999999999999999999)" to be reported as zero.
Note that the much larger value "e(-300)" is reported as zero.

(3) That bc does not run out of memory when calculating e(large negative
number).

Best,
--Lorenz


-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (1000, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.6-trunk-rt-amd64 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bc depends on:
ii  install-info  4.13a.dfsg.1-10
ii  libc6         2.13-37
ii  libncurses5   5.9-10
ii  libreadline6  6.2+dfsg-0.1
ii  libtinfo5     5.9-10

bc recommends no packages.

bc suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to