Function googology::knuth_yllion::power_of_ten[][src]

pub fn power_of_ten(digits: &str) -> Result<String, ParseError>

Gives a name for a number representing a power of ten. This function is equivalent to using full_name with a one followed by as many zeroes as would be indicated the number described by digits. Due to the exponential nature of Knuth’s Yllion system, however, this function may output yllion names that could not by outputted by any input to the full_name function. Unfortunately, there are still some inputs too large for this function to handle at the current time, so an Err may still be returned

Arguments

  • digits - A string slice that holds a representation of the number using only the digits 0-9. If any other character is present, this function will return an Err.

Example

use googology::knuth_yllion::power_of_ten;
let one_hundred_myllion = power_of_ten("10").unwrap();
assert_eq!("one hundred myllion", one_hundred_myllion.as_str());