My Math Forum Programs for floating point numbers to text.

 Computer Science Computer Science Forum

 March 10th, 2019, 07:55 PM #1 Banned Camp   Joined: Nov 2018 From: Mumbai Posts: 32 Thanks: 1 Programs for floating point numbers to text. Reference : https://www.google.com/amp/s/www.gee...-to-words/amp/ Can we write computer programs which will convert a floating point or decimal number in words? Programming languages could be C,C++,Java,C#, Python etc. Example : Input 375.50 Output Three hundred seventy five and fifty only. Thanks & Regards, Prashant S Akerkar
 March 10th, 2019, 08:11 PM #2 Math Team     Joined: May 2013 From: The Astral plane Posts: 2,079 Thanks: 845 Math Focus: Wibbly wobbly timey-wimey stuff. Yes. Please let us know what you have tried and we'll give you a hand where you need it. -Dan
March 10th, 2019, 08:41 PM   #3
Senior Member

Joined: Aug 2012

Posts: 2,204
Thanks: 647

Quote:
 Originally Posted by akerkarprash Reference : https://www.google.com/amp/s/www.gee...-to-words/amp/ Can we write computer programs which will convert a floating point or decimal number in words? Programming languages could be C,C++,Java,C#, Python etc. Example : Input 375.50 Output Three hundred seventy five and fifty only. Thanks & Regards, Prashant S Akerkar
Yes, that would be a nice exercise for late in the semester of a beginning programming class. You should take a shot at it, it's a fun challenge.

What's more interesting is that you CAN'T write a computer program to tell you whether a floating point number is zero. That problem is noncomputable. Many rounding errors lurk therein; and chaos theory tells us that rounding errors matter.

March 10th, 2019, 09:11 PM   #4
Global Moderator

Joined: Dec 2006

Posts: 20,373
Thanks: 2010

Quote:
 Originally Posted by akerkarprash convert a floating point or decimal number in words?
What did you mean by "floating point number"? Did you mean "into words" rather than "in words"?

 March 10th, 2019, 09:56 PM #5 Banned Camp   Joined: Nov 2018 From: Mumbai Posts: 32 Thanks: 1 Thanks. Examples of floating point or decimal numbers : 2.3,43.11,567.50,89.23 etc Thanks & Regards, Prashant S Akerkar
 March 11th, 2019, 05:52 AM #6 Global Moderator   Joined: Dec 2006 Posts: 20,373 Thanks: 2010 Can you define "floating point number" precisely (without giving examples), rather than give examples that might instead be decimals? Also, can you answer regarding the wording you used?
March 11th, 2019, 07:54 AM   #7
Senior Member

Joined: Apr 2014
From: UK

Posts: 898
Thanks: 329

Quote:
 Originally Posted by akerkarprash 375.50 Output Three hundred seventy five and fifty only.
That's incorrect, the output should be:

Three hundred (and) seventy five point five zero

 March 11th, 2019, 09:47 PM #8 Banned Camp   Joined: Nov 2018 From: Mumbai Posts: 32 Thanks: 1 Programs for floating point to Words. Thanks. I agree. Thanks & Regards, Prashant S Akerkar Last edited by akerkarprash; March 11th, 2019 at 09:48 PM. Reason: Content updates.

 Tags floating, numbers, point, programs, text

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post akerkarprashant Computer Science 6 November 2nd, 2018 10:06 AM abdel Computer Science 4 June 14th, 2017 12:30 AM abady-1 Number Theory 5 September 21st, 2013 02:08 PM Primalscientist Computer Science 9 June 2nd, 2011 06:29 AM RonnieStokie Algebra 3 December 12th, 2007 09:36 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top