Earlier this year, I released some routines for 128-bit large integers. I've since been working on actually doing something with those routines. (The division routine is still terrible.) Programmer's Calculator provides functionality useful for programmers, namely arithmetic in binary, hex, and decimal, for numbers up to 128 bits in size. The idea here is that when working on a project, you can use this as a quick desktop calculator instead of having to switch to another window.

A beta demo is available on the GitHub page. Since this is an early beta, the UI is pretty basic. It's an RPN (Reverse Polish Notation) system, with the idea being that it's easier to make a UI that handles RPN than a UI that handles traditional algebraic input style.

Planned features include octal, a proper UI for selecting settings, more UI decoration so you can actually tell what you're looking at, more arithmetic and logic functions, scrolling for the stack, other stack manipulation functions, and a cache of the previous stack from the last time you ran the program.
If you haven't been following the GitHub repo (and I know you haven't), you might have gotten the impression this project is dead. It is not. I've released a new beta that's fully functional, though a bit unintuitive. Nevertheless, you can do arithmetic and convert bases readily. The RPN stack may take some getting used to, but it made the UI a lot easier to implement.


For the approximately none of you who were waiting for me to finish this project, please enjoy version 1.0. It has a very sophisticated widget subsystem that implements the settings dialog (and some other dialogs). It's even got support for modal dialogs. Since I transformed the entire user interface system into an event-driven system, main() is now very short. There's also a manual with a full list of what keys do.



Looking great DrDnar!

I like the idea of an event driven ui, very slick Smile
I've added some minor improvements to the program: your stack can now be saved and restored when you quit and resume the program, and leading zeros are now grayed out for improved readability.





What I really want to know is if people will keep their calculator on their desk when programming so they always have a programmer's calculator handy. I wrote this because I wanted such a thing.
This looks really nice! If I actually used my calculator any more, I'd probably use this instead of the Windows calculator in programming mode, which is good but not great.

Your post about graying out leading zeros got me thinking: what about leading F's (hexadecimal) for "negative" numbers? Maybe that's a little silly, but perhaps less silly is allowing display bases to be specified as signed, so small negative values would still show up with leading zeros that can nicely be grayed out.
Oh, this is super-snazzy. While I also tend to use the Windows' calculator's programming mode for my bit/change-of-base computations, this looks like a strong candidate to replace it (especially, as Runer112 said, if my calculator was handy more).
For anybody who happens upon this thread while browsing, this program is also in the Cemetech archives.
Runer112 wrote:
Your post about graying out leading zeros got me thinking [about] . . . allowing display bases to be specified as signed, so small negative values would still show up with leading zeros that can nicely be grayed out.

Implemented in the latest release. I've also added options to always display a base on the current input or most recent stack entry. For example, you could have it display a binary conversion just for what you're currently entering, without having to set it as a secondary base that's displayed for every number on the stack.
Very nice - is the leading zero's feature an option that can be toggled or is it baked into the program?
The formatting code always displays the zeros. I'd have to completely rewrite the display logic to change that. Which I suppose wouldn't be too hard, but I don't feel a particular need for it.
Oh sorry I meant the leading zero colouring option - I like having leading zero's normally.

Unless that is what you were also referring to?

I haven't updated yet is all, will do when I get home from work Smile.
tr1p1ea wrote:
Oh sorry I meant the leading zero colouring option - I like having leading zero's normally.

Just for you, I made it a configurable option. Just look at how much code it took to implement that. I'm uploading a new release now.
Lol oops! Very Happy

Awesome work as always DrDnar!!! I have a calc on my desk permanently and this is perfect.
But I want the leading zeros to be blue, not gray.
This is really cool! Good Idea I agree with MateoConLechuga, it would be cool if you could have custom colors for the leading zeros. (or all the text/backgrounds?)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement