Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bit field view of a number in programmer mode #513

Open
SekoiaTree opened this issue Jan 16, 2024 · 3 comments
Open

Bit field view of a number in programmer mode #513

SekoiaTree opened this issue Jan 16, 2024 · 3 comments

Comments

@SekoiaTree
Copy link

SekoiaTree commented Jan 16, 2024

Hi,

I was wondering if there was a way to view a bit field in the same way the GNOME calculator can:
image

I find it quite convenient to view the binary of a number or to flip specific bits, though it does take quite a lot of space.

Tangentially related, is there a way to convert the output of the previous calculation as another base without opening a new window? In the GNOME calculator I often do "number -> enter -> hexadecimal" to convert a number to hexadecimal, without leaving the main UI.

Edit: found an answer to the above, just need to do to bin or to hex and such, which is straightforward enough (though I'd still prefer just pressing the button, this is good enough).

@hanna-kn
Copy link
Contributor

I was wondering if there was a way to view a bit field in the same way the GNOME calculator can

qalculate-gtk will actually show position numbers for binary output, but only when forced the use a horizontal scrollbar for the result (which is a questionable design choice). It might be feasible to modify this behaviour to always show binary position numbers and allow bit flipping.

Tangentially related, is there a way to convert the output of the previous calculation as another base without opening a new window? In the GNOME calculator I often do "number -> enter -> hexadecimal" to convert a number to hexadecimal, without leaving the main UI.

In the programming keypad (which will always show all four common bases for integer results), you can right-click a number base button to only change the output base.

In the general keypad the number base menu (top-right), or the menu of the "x ➞" button (will only change the current result), can be used. It also possible to add custom buttons which change the number base of only the current result (removing the restore the previous base).

Alternatively you can use the context menu of the result or the Mode➞Number Base menu.

@SekoiaTree
Copy link
Author

Awesome, thanks

@hanna-kn
Copy link
Contributor

hanna-kn commented Jan 16, 2024

Note that qalculate-qt shows binary position and now supports bit flipping (implemented a few minutes ago).
Screenshot_20240116_162016

hanna-kn referenced this issue Jan 26, 2024
…higher than 16, and improve appearance; Click on binary number in result to flip bit; Remove "ALL" button (opened number bases dialog) from programming keypad; Add selection of number of bits (affects input and output of binary and hexadecimal numbers, and default number of bits for "cmp" and "rot") to programming keypad; Fix conversion to angle unit for complex angle, cis and polar forms; Suggest conversion to angle unit when expression contains inverse trigonometric function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants