radix

How do you calculate floating point in a radix other than 10?

Given Wikipedia's article on Radix Point, how would one calculate the binary equivalent of 10.1 or the hex equivalent of 17.17? For the former, what is the binary equivalent of a tenth? For the latter, the hex representation of 17/100? I'm looking more for an algorithm than for solutions to just those two examples. ...

radix sort on binary strings with arbitrary length

hi, i googled around and see lots of discussion about radix sort on binary string, but they are all with same lenght, how aobut binary string with arbitrary lenght? say i have {"001", "10101", "011010", "10", "111"}, how do i do radix sort on them ? Thanks! ...

convert integer to a string in a given numeric base in python

Python allows easy creation of an integer from a string of a given base via int(str,base). I want to perform the inverse: creation of a string from an integer. i.e. I want some function int2base(num,base) such that: int( int2base( X , BASE ) , BASE ) == X the function name/argument order is unimportant For any number X and ba...

Implementing a Patricia Trie for use as a dictionary

I'm attempting to implement a Patricia Trie with the methods addWord(), isWord(), and isPrefix() as a means to store a large dictionary of words for quick retrieval (including prefix search). I've read up on the concepts but they just aren't clarifying into an implementation. I want to know (in Java or Python code) how to implement the T...

LSD Radix Sort code in java, question

A am studding for an Exam that I will have about sorting algorithms. And a Friend of mine gave me this code about LSD Radix Sort. And I don't why he is using the numbers 96,97 and 64? I've read a few things about LSD radix sort, but I didn't understand too much how it works. public class LSDRadix { private static String[] list; public...

snprintf : simple way to force . as radix?

My program was not behaving correctly on one machine so I started to hunt for the bug, and I discovered that on that machine, snprintf uses a comma (,), not a . (dot) as 99% of other computers (at least in my experience). Shouldn't this be standardized? I am using a library that assumes that the radix is a . (dot) and so it does not wo...

Javascript parseInt with radix 16 issue

The alert statement alert(parseInt("0x00C02700010004E9",16)); incorrectly displays 54086076498707690 instead of the correct value 54086076498707689. Please notice the last two digits!! Could anyone shed some light on what am I doing wrong? ...