Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Tuesday, May 28, 2013

I do the stupid so you don’t have to

So you want to use bc for some hexadecimal maths. You set the input base:

ibase=16

and the output base:

obase=16

Oops! I just set it to output in base 22. I’d already set it to think numbers were input in hexadecimal, and that’s how it handled the “16” in my obase command. Either do this:

ibase=16
obase=10

Or this:

obase=16
ibase=16
posted by Graham at 14:48  

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress