After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 157961 - gcalctool-ng - Bitcalculating extension for gcalctool
gcalctool-ng - Bitcalculating extension for gcalctool
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: 2.18.x
Assigned To: Rich Burridge
Rich Burridge
: 310902 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-11-11 15:50 UTC by Rich Burridge
Modified: 2006-09-22 15:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Image showing feature applied to very old calctool. (11.10 KB, image/png)
2004-11-11 15:52 UTC, Rich Burridge
  Details
Another image showing feature. (11.11 KB, image/png)
2004-11-11 15:52 UTC, Rich Burridge
  Details
Patch for this feature to very old version of calctool. (44.92 KB, application/octet-stream)
2004-11-11 15:53 UTC, Rich Burridge
  Details
Patch to implement this functionality for non-arithmetic operator precedence mode. (11.09 KB, text/plain)
2005-09-23 20:29 UTC, Rich Burridge
  Details
A preview of bitcalculation extension for arithmetic precedence mode. (10.31 KB, patch)
2006-09-21 22:04 UTC, Sami Pietilä
none Details | Review

Description Rich Burridge 2004-11-11 15:50:22 UTC
Bitcalculating extension for (g)calctool
just as already said in the mail to Rich I've done an
extension
for calctool-2.4pl13 which may also a nice to have feature
for successor gcalctool. The patch in the attachment
implemenst a further window for displaying the bitvalue
of the current displayed number with buttons for every bit.

In other words: if the window is pop up, any typed number
regardless of its basic is shown with highlighted buttons
representing the bit value. The user is able to change
directly the bit values which is also visible in the
changed
value in the number display.

For an impression see

http://www.suse.de/~werner/bitcalc1.png
http://www.suse.de/~werner/bitcalc2.png

...

In the patch the cpp macro USE_BITCALC is used to
switch the feature on or off at compile time. Maybe some
lines of the code can be used for implementing the
Bitcalculating extension in the scientific format.
Comment 1 Rich Burridge 2004-11-11 15:52:21 UTC
Created attachment 33677 [details]
Image showing feature applied to very old calctool.
Comment 2 Rich Burridge 2004-11-11 15:52:46 UTC
Created attachment 33678 [details]
Another image showing feature.
Comment 3 Rich Burridge 2004-11-11 15:53:40 UTC
Created attachment 33679 [details]
Patch for this feature to very old version of calctool.

Note that this patch would have to be reworked to 
make it applicable for gcalctool.
Comment 4 Rich Burridge 2005-09-16 17:22:30 UTC
The latest version of the calculator in Mac OS X
(Tiger) has this for the Programmer View, and it's very nice. 

The only thing that's preventing this in gcalctool is how to handle it in
arithmetic operator precedence mode where there is an expression
being built up in the display area. The Mac calculator doesn't have
this problem because it only ever displays the latest number being
entered (and it correctly does arithmetic operator precedence).

If anybody has any idea how to implement the bit calculation display
for arithmetic operator precedence mode with our current setup, please
let me know.
Comment 5 Rich Burridge 2005-09-23 20:29:00 UTC
Created attachment 52573 [details]
Patch to implement this functionality for non-arithmetic operator precedence mode.

Two changes:

* Adjusted the mpcmim() routine in mp.c. The fix for Sun bug #4006391
  needed to also preserve v->toclear and v->pointed.

* Implemented the bit panel for non-arithmetic precedence mode.  
  It's automatically displayed when in Scientific mode. It is only
  sensitive when integer (upto 64 bit integers) are being displayed.
Comment 6 Rich Burridge 2005-09-23 20:31:07 UTC
Changes to implement this functionality for non-arithmetic
operator precedence mode have been checked into CVS HEAD.
I've bumped the version number in configure.in to 5.7.6.

Transferring to Sami now, to see if he can implement similar
functionality for arithmetic operator precedence mode.
Comment 7 Rich Burridge 2005-09-23 20:33:39 UTC
*** Bug 310902 has been marked as a duplicate of this bug. ***
Comment 8 Rich Burridge 2006-09-06 14:15:48 UTC
Adjusting summary to reflect that this enhancement still
needs to be implemented for the arithmetic operator
precedence mode.
Comment 9 Sami Pietilä 2006-09-21 22:04:09 UTC
Created attachment 73174 [details] [review]
A preview of bitcalculation extension for arithmetic precedence mode.

A preview of bitcalculation extension for arithmetic precedence mode.

The existing bitcalculating extension don't seem to be able to handle negative numbers. Rich, are you able to modify the printing in such a way that the negative numbers are also handled?
Comment 10 Rich Burridge 2006-09-22 15:31:06 UTC
I've checked in your changes (thanks!).
It should be able to handle negative numbers with the
big calculating extension. I've opened a new enhancement 
request to cover this. See bug #357208.

As we now have a par for this feature in both arithmetic
modes, I'm closing this bug as FIXED.

I'll also update the documentation bug #309210 with the
suggested changes needed to the gcalctool documentation.