Questions tagged [number-systems]
Questions about representing numbers in alternative representations, such as hexadecimal or Mayan
123 questions
4 votes
4 answers
479 views
Convert the number formats (Decimal - Hexadecimal - Octal) to Decimal
Problem statement: Write a program called multi_input.cpp that prompts the user to enter several integers in any combination of octal, decimal, or hexadecimal, ...
4 votes
2 answers
9k views
Printing a number in binary in C
I wrote a short function whose purpose is simple: Print the binary representation of number to the console. I also aim to be as portable as possible, hence my use of ...
9 votes
1 answer
313 views
Convert integer to Roman numeral string
This is my 1st time developing PHP code and I am only 13 years old. I have experience in other programming languages like lua, python, and c++. This is a simple Number to Roman Numeral code I made for ...
3 votes
1 answer
351 views
Increment a binary number represented as a string
I'm an amateur at assembly, but am trying to get better at it. For fun, I decided to write code that takes in a char array and increments the number represented in binary. Here are a few input-output ...
8 votes
2 answers
2k views
Encode and decode string as base-32 number
I wrote a program that can take any English text and transform it into an integer and vice versa. My method I use two dictionaries to map between letters and numbers. I chose base 32 because it is a ...
4 votes
1 answer
312 views
Decibinary for xth number (Python code)
I created the code for the problem description below. It works for \$N\le10^6\$ but after that it gives a time out error. What I don't understand is how to optimize the code using dynamic programming. ...
1 vote
3 answers
255 views
Convert from decimal to binary and octal
I wrote a program that implements an algorithm that converts from decimal to binary and octal Please criticize my implementation. What else can I do to improve? ...
3 votes
1 answer
280 views
Python 3 number convertor that converts floats between decimal and bases 2-36
This is a Python 3 script that converts any real number (ints and floats) from decimal notation to any positional number system ...
5 votes
4 answers
3k views
C++ basic bank money class
I am trying to create a basic money class that fits into a small console banking application I am making. Money.h ...
0 votes
1 answer
111 views
2 ConvertToBase3 methods with great disparity of execution time
I have two methods to do the same thing: convert a number to ternary. ...
0 votes
3 answers
932 views
4 votes
1 answer
440 views
Number system converter GUI
This program converts from number system A to number system B as soon as you input something in it, as a rookie it took a lot of thinking to make it work a seamless and fool-proof way. It converts ...
4 votes
0 answers
967 views
Binary to hex in ARM64 SIMD assembly
As an exercise in learning ARM64 assembly (aka AArch64), I wrote this function to convert 64-bit binary to hexadecimal with SIMD instructions. I'm most interested in feedback on the algorithm, ...
5 votes
2 answers
4k views
Represent integer as binary in C
To practice my C, I've written a small function in C to display an integer as an 8-bit binary number. Please let me know how to improve this function, and other C-style coding conventions. Thanks! <...
1 vote
1 answer
693 views
Converting decimal to binary in Assembly
The longest example program in my PicoBlaze Simulator in JavaScript is this decimal-to-binary converter: ...