Re: [OT] GNU bc base conversion

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



On Mon, Aug 31, 2015 at 11:15 AM, Warren Young <wyml@xxxxxxxxxxx> wrote:

> On Aug 31, 2015, at 6:55 AM, Mike - st257 <silvertip257@xxxxxxxxx> wrote:
> >
> > I suppose my only options for this are to use shell functions or write a
> > script using a language that handles things properly (sanely?).
>
> No, there’s a fairly common hack around this problem: ibase=A and obase=A
> *always* means “base 10” regardless of the current base, due to a quirk in
> the way values for these settings are interpreted.  Thus you can always
> force your way back to sanity.
>

Not sure how this helps me with my most recent example of bin_to_hex where
the ibase within the define clause wasn't honored.

Working with bc interfactively or by piping produce the desired/correct
values.
Testing indicates the ibase is defaulted or overrode as base10 despite what
is specified in the define clause. :-(


>
> My objection is that this is even necessary in the first place.


Agreed.


-- 
---~~.~~---
Mike
//  SilverTip257  //
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux