100,000,000 + 25,000,000 + 700,000+ 40,000 + 600 + 80 + 9 voila and thank you!
Six million, seven thousand, two hundred.
three hundred and eight thousand three hundred and twenty-one
24000 = 20000 + 4000 in expand form
For example, as the sum of two numbers, as the difference of two numbers, etc.
Expand generally means to expand the problem. I'm assuming this is a function, you'd expand it into a simpler form (factor things out and such).
it is two million five hundred and eighty three thousand two hundred and sixty four
Fourteen thousand six hundred eighty nine.
six hundred eighty two milion, three hundred sixty-four thousand, five hundred eighteen
Six million, seven thousand, two hundred.
three hundred and eight thousand three hundred and twenty-one
One hundred fifty million.
#include<iostream> class expand { public: expand(unsigned long long num):value(num){} std::ostream& operator()(std::ostream& out)const; private: unsigned long long value; static const char * const units[20]; static const char * const tens[10]; }; const char * const expand::units[20] = {"zero", "one", "two", "three","four","five","six","seven", "eight","nine", "ten", "eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen", "eighteen","nineteen"}; const char * const expand::tens[10] = {"", "ten", "twenty", "thirty","forty","fifty","sixty","seventy", "eighty","ninety"}; std::ostream &operator<< (std::ostream &out, expand number) { return(number(out)); } std::ostream &expand::operator()(std::ostream &out) const { const unsigned long long quintillion=1000000000000000000; const unsigned long long quadrillion=1000000000000000; const unsigned long long trillion=1000000000000; const unsigned long long billion=1000000000; const unsigned long long million=1000000; const unsigned long long thousand=1000; const unsigned long long hundred=100; const unsigned long long twenty=20; const unsigned long long ten=10; unsigned long long multiple=quintillion; unsigned long long remain; if(value>=thousand) { while(multiple>value&&(multiple!=quintillionmultiple!=quadrillion multiple!=trillionmultiple!=billionmultiple!=millionmultiple!=thousand)) multiple/=1000; out<<expand(value/multiple); switch(multiple) { case(quintillion):out<<"-quintillion"; break; case(quadrillion):out<<"-quadrillion"; break; case(trillion):out<<"-trillion"; break; case(billion):out<<"-billion"; break; case(million):out<<"-million";break; case(thousand):out<<"-thousand";break; } if(remain=value%multiple) { if(remain<hundred) out<<"-and"; out<<"-"<<expand(remain); } } else if(value>=hundred) { out<<expand(value/hundred)<<"-hundred"; if(remain=value%hundred) out<<"-and-"<<expand(remain); } else if(value>=twenty) { out<<tens[value/ten]; if(remain=value%ten) out<<"-"<<expand(remain); } else out<<units[value]; return(out); } int main() { for(unsigned long long ull=0; ull<0xffffffffffffffff; ++ull) std::cout<<expand(ull)<<std::endl; return(0); }
One thousand + four hundred + ninety + two or (1 * 103) + (4 * 102) + (9 * 101) + (2 * 100)
24000 = 20000 + 4000 in expand form
#include<iostream> class expand { public: expand(unsigned long long num):value(num){} std::ostream& operator()(std::ostream& out)const; private: unsigned long long value; static const char * const units[20]; static const char * const tens[10]; }; const char * const expand::units[20] = {"zero", "one", "two", "three","four","five","six","seven", "eight","nine", "ten", "eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen", "eighteen","nineteen"}; const char * const expand::tens[10] = {"", "ten", "twenty", "thirty","forty","fifty","sixty","seventy", "eighty","ninety"}; std::ostream &operator<< (std::ostream &out, expand number) { return(number(out)); } std::ostream &expand::operator()(std::ostream &out) const { const unsigned long long quintillion=1000000000000000000; const unsigned long long quadrillion=1000000000000000; const unsigned long long trillion=1000000000000; const unsigned long long billion=1000000000; const unsigned long long million=1000000; const unsigned long long thousand=1000; const unsigned long long hundred=100; const unsigned long long twenty=20; const unsigned long long ten=10; unsigned long long multiple=quintillion; unsigned long long remain; if(value>=thousand) { while(multiple>value&&(multiple!=quintillionmultiple!=quadrillion multiple!=trillionmultiple!=billionmultiple!=millionmultiple!=thousand)) multiple/=1000; out<<expand(value/multiple); switch(multiple) { case(quintillion):out<<"-quintillion"; break; case(quadrillion):out<<"-quadrillion"; break; case(trillion):out<<"-trillion"; break; case(billion):out<<"-billion"; break; case(million):out<<"-million";break; case(thousand):out<<"-thousand";break; } if(remain=value%multiple) { if(remain<hundred) out<<"-and"; out<<"-"<<expand(remain); } } else if(value>=hundred) { out<<expand(value/hundred)<<"-hundred"; if(remain=value%hundred) out<<"-and-"<<expand(remain); } else if(value>=twenty) { out<<tens[value/ten]; if(remain=value%ten) out<<"-"<<expand(remain); } else out<<units[value]; return(out); } int main() { for(unsigned long long ull=10000000; ull<100000000; ++ull) std::cout<<expand(ull)<<std::endl; return(0); }
it is possible but the chances are extremely unlikely. It is far too small. Most likely it will expand into a Red Giant as it dies, in about 4 thousand million years' time.
Six and five hundred thirty-two thousandths.