Tuesday, January 01, 2008 1:11 PM
Recently I've been working on a new project that requires more math and calculations that I'm usually up for. Anyway, one of these routines require a conversion to quadragesimal which is base 40. However, after 2 hrs of research I could not find anything in the .Net Framework library to convert to any base higher than sexadecimal, also known as hexadecimal.
The "System.Globalization.NumberStyles" has a few number styles that you can easily cast to including Hex but that is as far as it goes. I was baffled that .Net Framework does not have any complex conversion routines, so I resulted to searching for other languages that may have a way - I figured I may be able to copy code as usual or at least have some kind of guide to writing one.
With my hair raised at the back of my head, I gazed on the java ParseInt method.
Java Leads: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/...
Sexadecimal Example: ParseInt("-FF", 16)
Binary Example: ParseInt("1100110", 2)
Sexatrigesimal Example: ParseInt("sr66", 36)
Why don't we have one of these? I'm I missing something, please let me know if there is a way! It seems .Net Framework only supports bases 2, 8, 10 and 16. We need more!!! or at least I do! Microsoft please copy the Java ParseInt. We need a much more complicated/complex radix class. I'm off to writing one.