[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bc and dc.

From: Ralph Corderoy
Subject: Re: bc and dc.
Date: Fri, 28 Apr 2023 14:43:44 +0100

Hi Alejandro,

> I could only see this:
>     $ echo 'l(1114112) / l(2)' | bc -lc
>     @iK1114112:C2,0:K2:C2,0:/W@r
>     @i

That's GNU bc.  Its -c dumps its internal byte code rather than dc code
because it nevers runs dc.

>     $ echo 'l(1114112) / l(2)' | /usr/lib/plan9/bin/bc -c
>      1114112 l<12>x 2 l<12>x/ps.
>     q

That's correct output.  The <12> is ASCII FF and is the name of the l()
function as defined by the dc code in bc's -l maths library.

>     $ echo 'l(1114112) / l(2)' | /usr/lib/plan9/bin/bc -lc
>     c[cannot open input file:1, ]pc
>      1114112 l<12>x 2 l<12>x/ps.
>     q

There's your problem.  When your plan9/bin/bc is given -l, it produces
dc to print ‘cannot open input file:1, ’.  Looks like the installation
is incomplete or the file is present but in the wrong place.

At a guess, have you a /usr/lib/plan9/lib/bclib?

Cheers, Ralph.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]