base-conversion Questions
9
I need to convert a binary input into a decimal integer. I know how to go from a decimal to a binary:
n = int(raw_input('enter a number: '))
print '{0:b}'.format(n)
I need to go in the reverse d...
Carabiniere asked 13/2, 2014 at 21:23
4
Solved
So I just learned Integer.toString(int x, int radix); and thought it was pretty awesome since it makes base conversions super easy.
However, I'm trying to write with Base-26 phonetically (a - z) a...
Pleuro asked 19/1, 2017 at 3:32
3
I only have shell available no bash, Perl, python etc.
Using printf small numbers work:
root@DD-WRT:/jffs# printf "%d\n", 0x15a
346
But large numbers fail.
root@DD-WRT:/jffs# printf "%d\n", 0x...
Biome asked 24/9, 2018 at 18:47
7
Solved
Is there a way to take any number, from say, 1 to 40000 and generate an 8 character hash?
I was thinking of using base_convert but couldn't figure out a way to force it to be an 8 character hash.
...
Bituminous asked 26/3, 2010 at 2:20
5
Solved
I want to write a program to convert from decimal to negabinary.
I cannot figure out how to convert from decimal to negabinary.
I have no idea about how to find the rule and how it works.
Exampl...
Tattletale asked 17/2, 2012 at 15:28
3
Solved
Recently, I was reading about the Ancient Babylonian Civilization that used a number system with base 60 instead of base 10. Even with this number system at base 60, they were still able to approxi...
Huberty asked 30/1, 2022 at 19:44
6
Solved
I have just recently started learning C. I wrote a very short program that converts between decimal and binary. I wanted to try and write a code that converts between decimal and any base (up until...
Guardhouse asked 22/10, 2018 at 15:19
6
Solved
I have an array of unsigned chars in c I am trying to print in base 10, and I am stuck. I think this will be better explained in code, so, given:
unsigned char n[3];
char[0] = 1;
char[1] = 2;
char...
Weatherley asked 11/5, 2009 at 19:15
4
Solved
I was wondering, how do you convert a base10 number from one base to another without usage of strconv in Golang ?
Could you please give me some advice ?
Muskogee asked 2/2, 2017 at 7:50
7
Solved
I want to convert my binary(which is in string) to hexadecimal string also, this is just a program fragment since this program is just a part of another bigger program:
//the variable name of the ...
Montreal asked 31/8, 2014 at 12:41
1
Solved
Let's say I have a max 32-bit integer -
const a =
((2 ** 32) - 1)
const b =
parseInt("11111111111111111111111111111111", 2) // 32 bits, each is a one!
console.log(a === b) // true
...
Weed asked 28/3, 2019 at 5:56
3
Solved
To generate a UFI number, I use a bitset of size 74. To perform step 2 of UFI generation, I need to convert this number:
9 444 732 987 799 592 368 290
(10000000000000000000000000000101000001000001...
Stability asked 26/7, 2018 at 14:46
4
Solved
I would like to reverse the operation performed by the following bash command:
$ echo $((62#a39qrT))
9207903953
i.e. convert decimal 9207903953 to base 62, keeping bash standard of {0..9},{a..z}...
Punch asked 23/1, 2013 at 2:55
6
Solved
I need a base_convert() function that works from base 2 up to base 62 but I'm missing the math I need to use, I know that due to the limitations of PHP I need to make use of bcmath, which is fine.
...
Tactful asked 21/12, 2009 at 3:34
2
Solved
Could you provide a convincing explanation, or a mathematical proof, to why the following function calculates the negabinary representation of a given number?
function quickNegabinary(number) {
v...
Pokey asked 5/6, 2016 at 2:8
3
I currently convert base10 numbers to base64 in PHP.
but I haven't any idea for convert base64 to base10 in php!
How can I do it?
my algorithm for convert base10 to base64:
$rep = array('0','1',...
Carlstrom asked 8/6, 2012 at 19:15
4
Solved
I'm trying to a create an algorithm that can convert base 10 numbers into base n numbers, where n is at most 10. However, for some weird reason the following algorithm in C fails at certain critica...
Crispation asked 23/7, 2014 at 17:4
5
Solved
Is there a built in way to convert an integer in Ruby into its hexadecimal equivalent?
Something like the opposite of String#to_i:
"0A".to_i(16) #=>10
Like perhaps:
"0A".hex #=>10
I kn...
Bloodshot asked 17/9, 2008 at 15:23
3
Solved
I trying to do conversions between Binary, Octal, Decimal and Hexadecimal in Objective-C.
I had problems converting Octal to Decimal.
I have tried the following:
NSString *decString = [NSString ...
Gershon asked 10/10, 2012 at 11:31
2
Solved
I'm trying to write a C++ program that does base-conversions.
I want to convert a decimal number to all the other integer bases from 2 to 20.
Is there an efficient and easy-to-implement a...
Unthinkable asked 3/10, 2012 at 17:47
1
I have a very big number, on the order of a thousand decimal digits, and I have to convert this to its binary representation. The numbers are stored as strings.
Since few languages have a ba...
Halford asked 13/6, 2012 at 0:49
4
Solved
Is there any python module that would help me to convert a string into a 64-bit integer?
(the maximum length of this string is 8 chars, so it should fit in a long).
I would like to avoid having to...
Twobit asked 23/5, 2012 at 9:9
3
Solved
Is there a platform function that will do the following?
convertBase :: (Num a, Num b) => Int -> Int -> [a] -> [b]
Convert a number from base 'a' to base 'b' where each list item is ...
Searching asked 5/4, 2012 at 12:2
6
Solved
I can do this:
int main(int argc, char** argv) {
unsigned char cTest = 0xff;
return 0;
}
But what's the right way to get a hexadecimal number into the program via the command line?
unsigned ...
Assail asked 29/1, 2010 at 15:15
2
Solved
I'm trying to implement a BigInt type in JavaScript using an array of integers. For now each one has an upper-bound of 256. I've finished implementing all integer operations, but I can't figure out...
Outride asked 3/5, 2011 at 23:6
1 Next >
© 2022 - 2024 — McMap. All rights reserved.