Questions tagged [base-conversion]

Base conversion is the process of changing the base of the textual representation of a number to another base. For example, "1010" in binary to "10" in decimal is a base conversion.

Base conversion is the process of changing the base of the textual representation of a number to another base. For example, 1010 in binary to 10 in decimal is a base conversion.

198 questions
0
votes
3 answers

Hexadecimal to Decimal In Excel

I am trying to convert a Hexadecimal value to a decimal one in excel with this reference. Used parameters and formulas: Input Hex value : 0x044F3B9AFA6C80 and expected output : 1213017328610432 Method1: Applying excel…
0
votes
1 answer

Can't get the output I need

#include #include int main(){ int base5_v; int digit = 0; printf("> "); scanf("%d", &base5_v); int remainder = base5_v % 10; base5_v /= 10; int base10_v = remainder * (int) powf(5, digit++); …
Y Wei
  • 1
0
votes
2 answers

Conversion from any base to decimal and case sensitivity

I am using the following portal to verify the results of my code (again sourced from the web): RapidTables BaseConverter My code is as shown below: // C program to convert a number from any base // to decimal #include #include…
Vinod
  • 925
  • 8
  • 9
0
votes
1 answer

How to convert base 10 negative number to base 8 conversion without using Convert.To() method?

How can i represent decimal negative number in octal without using Convert.To() method? public static string GetOctal(int number) { int base = 8; } So for example : -3 (base 10) = 37777777775 (base 8) But what algorithm should i use…
0
votes
1 answer

how to print multiple separate for loop outputs as columns in bash

I have a script that I want to read a list of binary values and print them as follows (in columns, but not necessarily labelled accordingly)- binary decimal truncated truncated-decimal etc. -with subsequent columns being truncated…
Dysclidean
  • 33
  • 4
0
votes
2 answers

How did I create an infinite loop when trying to convert bases

I'm trying to write code that will take any decimal value and then convert it to any input base. I've created an infinite loop and I've read through suggested similar questions but I just cannot work it out. Any assistance would br really…
Sessamel
  • 1
  • 3
0
votes
1 answer

Can I add numbers of different bases by converting both numbers to base 10, adding them and then converting to desired base?

I've been working on this mini app which adds numbers of whatever bases the user wants and then converts them to the base that he/she wants. Is it okay if I implement it this way? Or is there a better way?
0
votes
5 answers

Random string gets repeated?

I have a service on the internet where people post pictures and a short string is generated. Only one can be used ever. However, I am getting into duplicates in the database and I am seeing major problems. Here's what I am…
iosfreak
  • 5,228
  • 11
  • 59
  • 102
0
votes
1 answer

Program converts int into ASCII and I don't know why?

So I'm trying to convert a number from different bases to 10. I tried debugging and I'm 100% sure that the problem is here : nr[i]=j; What it does is that it takes the integer j and converts it into ASCII, regardless of the fact that nr[i] is a char…
manubmxnsb
  • 151
  • 1
  • 14
0
votes
0 answers

Debugging a base conversion calculator up to base 809

So my calculator is built for absolutely huge numbers. I am having a bit of fun here and making a base system based on the pokedex. So for example, base 151 would include all the Pokemon from generation 1, and base 809 goes all the way to Melmetal…
Citrus Rain
  • 119
  • 1
  • 4
  • 16
0
votes
1 answer

How to fix the code for base62 encoding with Python3?

I am creating a python script for base62 encoding. However, for some reason, my code doesn't produce the correct answer. Correct answer is LpuPe81bc2w, but i get LpuPe81bc0w. If you can review my code and see if I can do any different. Please let me…
lolo
  • 25
  • 4
0
votes
0 answers

Convert number to binary and hex in C

I want to a write a program that converts a number to binary and hex.I tried to do this but It gives me the wrong result int n, c, k; int t = 0; int binary[8]; for (c = 31; c >= 0; c--) { k = num >> c; if (k & 1) { printf("1"); …
We Que
  • 5
  • 3
0
votes
2 answers

Java Fraction Base Conversion

I want to convert a source base number to a destination base number, but I have a problem with fractions. When I trying to convert 10.234 (base10) to base 7 = 13.14315 it works perfectly, or aaaaa.0 (base16) to base 24 = 22df2 it also works. But…
androboy
  • 356
  • 1
  • 2
  • 9
0
votes
1 answer

How can I base-convert a large/high-precision floating-point number in PHP?

As generic of a question as this seems, I'm having a really hard time learning specifically about how to base-convert large high-precision float values in PHP using BCMath. I'm trying to base-convert something…
i336_
  • 1,813
  • 1
  • 20
  • 41
0
votes
0 answers

How to do a base conversion with Little Man Computer?

I need to convert a decimal number to a base between 2 and 9 using Little Man Computer. How do I proceed? I believe successive divisions are the best method. In my opinion, I must write a code which divides two numbers, then save the integer ratio…
QCyrax
  • 9
  • 1