Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Numbering System


Reply
 
Thread Tools Display Modes
  #1  
Old 07-24-2012, 08:05 AM
BrianCHarlie BrianCHarlie is offline
Newcomer
 
Join Date: Jan 2010
Posts: 14
Default Numbering System


Currently I am building a "Advanced Caculator" for my work place it includes Base 10, Binary, Octal, Hexadecimal, and Base31 add, subtract, divide, and multiply.

I've figured out how to do all the other ones but I am stumped when it comes to my base 31. The instructions I have is that its a custom system that uses all numbers 0-9 and all consonant letters B through Z including Y. (Z = 30 Base 10)

I am un sure what values you to give the letters to compute them correctly..
If I go Z = 30, Y = 29 it ends up being
E = 9, D = 8, C = 7, B = 6

Is this correct or am I missing something?
Reply With Quote
  #2  
Old 07-24-2012, 08:49 AM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 7,722
Default

I am unfamiliar with Base31, but a quick search seems to indicate there might be at least two encodings.
The "normal" would be what I would expect, and that is just continuing from Base16 so the last digit would be "U".

Another, which uses Y and Z, but skips some characters like "I" (i), "L" (l), "O" which are easily confused with other digits, would use Y in place of 0, and Z in place of 1.
The last digit in that series would be "X", so Z would be equal to 1, and Y = 0, X = 30.
Full series (in lower case)
"yz23456789abcdefghjkmnpqrstuvwx"

I guess the question is what Base31 representation do you want?
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.

Last edited by passel; 07-24-2012 at 09:47 AM.
Reply With Quote
  #3  
Old 07-24-2012, 01:21 PM
BrianCHarlie BrianCHarlie is offline
Newcomer
 
Join Date: Jan 2010
Posts: 14
Default

Thanks for the help..
I am not sure from what I read I would assume it uses 0-9 and then B to Z. The exact line in the instrunctions I have for making this part of my caculator is as follows: "Base31 is our companies numbering system that uses all numbers 0-9 and all consonant letters B to Z. (Z=30 base10)..

I assumed there was some way by that sentance to figure out their logic by it, but from my research on the internet my self and what you put I am still confused so I will try find out if anyone can give me some help on it. Thanks again for the help..
Reply With Quote
  #4  
Old 07-24-2012, 08:23 PM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 7,722
Default

Well that makes more sense to me.
I guess it is unique to your company, perhaps.
The point being, you have to remove 5 characters from your alphabet to get 31 total digits.
Your description says to use the consonants, so the five vowels are the letters not used.
(aeiou). I guess they wanted to be clear that Y is treated as a consonant, not a vowel, which is why you mentioned earlier including "Y".

I did overlook the attribute "consonant" the first read.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #5  
Old 07-25-2012, 06:36 AM
BrianCHarlie BrianCHarlie is offline
Newcomer
 
Join Date: Jan 2010
Posts: 14
Default

Thank you so much! I read over it a bunch of times and missed the constants my self, because ever time i tried to work it out it'd be wrong you know due to the 5 vowels.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->