14
1
Given a string, consisting of a prefix and then "illion", convert this number into standard form.
For example:
"million" -> 10^6
"trillion" -> 10^12
"quattuordecillion" -> 10^45
The program needs to be able to handle input going up to Centillion, which is 10^303. A list of names and their standard form values can be found here - note that this gives values for every 10^3 increment up to 10^63, but then gives them in 10^30 increments, however the pattern is fairly straightforward.
The program needs to handle all 100 cases (even the ones not explicitly given by the website provided) - here are some examples of this:
"sexvigintillion" -> 10^81
"unnonagintillion" -> 10^276
"octotrigintillion" -> 10^117
Input can be given via STDIN, function argument or hard-coded as a string.
This is code-golf, so shortest code wins!
Besides, in the long scale, one vigintillion would be 10^120. – SuperJedi224 – 2015-05-27T17:38:11.343
What would 10^70 be? – Scimonster – 2014-10-28T18:56:27.713
310^70 doesn't have a representation because 3 isn't a factor of 70 - but 10^69 would be sexvigintillion. 10^70 would be 10 sexvigintillion. – James Williams – 2014-10-28T19:02:39.077
Actually, doevigintillion = 10^69, and sexvigintillion = 10^81. – Remy – 2014-10-28T20:36:53.447
@Remy I would guess that you use the long scale (if that's right)? It sounds like this question uses the short scale. – Cole Johnson – 2014-10-29T02:59:26.487
@Cole Johnson: The question's provided list of names says vigintillion = 10^63, and shows that un- adds 3 to the power, doe- adds 6, sex- adds 18, etc. – Remy – 2014-10-29T03:15:27.973
@Remy You are absolutely right, apologies. – James Williams – 2014-10-29T11:40:53.003