Anything related to number systems, i.e. the way of representing numbers (the abstract mathematical entities) as finite sequences of symbols. Usually this tag is relevant on questions involving conversion from the representation in a number system to another (e.g. from decimal to binary).
Questions tagged [number-systems]
106 questions
0
votes
3 answers
How is it that in two's complement representation of integers, (2^32 - 1) evaluates to the same thing as -1?
Here's the work I've done so far:
2^32 = 10...0
subtract 1 -> 01...1
That gives you 32 1's
1 = 01
flip bits -> 11....10
add 1-> 1...1
That gives you 32 1's
Am I missing something? I'm asking because I tried a practice problem where you had to flip…
user12178194
0
votes
1 answer
How to convert string with float to decimal?
There are many discussions on methods of conversion strings with float to decimal float, but i didn't find solution of my problem in C++ (python, C#, etc. have nice & quick ones). Let me describe algorithm in brief.
Firstly, we enter number system…

Александр Евсиков
- 33
- 4
0
votes
1 answer
Does 2's representation of a positive number exist?
CASE 1:
Let me try to represent -7 in 2's complement in 4 bits:-
7 in binary : 0111
7 in 1's complement:1000
7 in 2's complement:1001
So converting my 2's number to decimal: -1x2^3+0+0+1x2^0
=>…

DrDoggo
- 149
- 10
0
votes
4 answers
Number System Accuracy
If there are 2 number system, e.g. Decimal Number System with 10 symbols (0-9) and hexadecimal with 16 Symbols (0-9,A-F), can i conclude that with hexadecimal, i will be able to retain greater accuracy than with the decimal number system due to the…

Noor
- 19,638
- 38
- 136
- 254
0
votes
1 answer
File reading in hexa editor
I am a bit curious about the file system and how a file is written in a disk.
I have written 23 in a file.
While opening this file in hex editor, I found this like below
Why the hex editor is showing the file this way? I am curious to know.

Noor A Shuvo
- 2,639
- 3
- 23
- 48
0
votes
1 answer
Inconsistently getting NumberFormatException when trying to convert binary to hex
If use variable bin1 it wont convert, however if i replace the parameter with bin2 it seems to work.
I tried using long instead of int. It's still the same.
public class Test{
public static void main(String[] args) {
String bin1 =…

BWB
- 5
- 3
0
votes
0 answers
How to put comma in number in Nepalese style in swift
I am having trouble showing commas in price in Nepalese style . The number should be shown as 5,00,00,000 rather than 500,000,000 which i got using NSNumber Formatter.

Asmita Upreti
- 9
- 2
0
votes
1 answer
I am having difficulty in understanding a line in a decimal to binary conversion program
Alright, I know this is a silly question to ask as it is related to reverse for loop but I am struggling to understand this. I even tried to make a separate reverse for loop program to clear the context but I am still in trouble.
So here is my…

that_noob
- 83
- 1
- 2
- 13
0
votes
0 answers
LC3 Number Systems
I'm confused at the wording of two questions
c. Give the LC-3 representation of -22 expressed as hexadecimal in a 16 bit word.
d. What integer does the 16 bits FF1A represent in the LC-3?
for c) is it just asking for -22 in hexadecimal which is…

rahulchawla
- 170
- 1
- 3
- 20
0
votes
1 answer
What is the purpose of different number systems in programming?
I am learning php language. I was reading an article on php language and came across usage of different number systems namely decimal, hexadecimal, and octal numbers. We use decimal numbers and I know this that computers feed on Binary(0 and 1). So…

Joy Grewal
- 67
- 6
0
votes
3 answers
unsigned long and atoi in C
Code:
char temp[] = "1010000001010011";
printf("%s\n", temp);
unsigned long num = atoi(temp);
printf("%lu\n", num);
Output:
1010000001010011
4081617243
Why is num not 41043?

Jerry G
- 1
- 1
- 1
0
votes
1 answer
Convert Marathi script (non-arabic) numbers to arabic numbers
If we get value from edit box as Marathi '१.२' then I want this value as 1.2 in float format, I tried _wtof () but it failed it returned only 0. Its work same as _wtoi (). It's ok but -_wtof ()? Please suggest anything another function.

Yogesh. MFC
- 9
- 1
0
votes
2 answers
c++, a converter from x number system to decimal
I wrote this code it seemed to good but the output is always 0 what could be the problem? I m just writing a code to convert from x number system to decimal.
#include
#include
using namespace std;
int main()…

Koreszka10
- 37
- 8
0
votes
0 answers
How to convert decimal number to binary, octal and hexadecimal number in SPIM?
.data
strIn: .asciiz "\nEnter a number:"
reply: .asciiz "\nYour input is:"
hexdigits: .asciiz "0123456789abcdef"
hexword: .asciiz "00000000"`
hexresult: .asciiz "\nHexadecimal code is:"`
buffer: .space 10
.text
.globl main
main:
#STEP 1 --…

Chun Yin Lai
- 1
- 1
0
votes
0 answers
Convert hex-timestamp back
I often see timestamp values in a form-field written in hex:
How can I calculate them back to something readable? First I thought about making Byte-Chunks and then…

IT-New
- 1