Topic: Rational and STL


Author: brownsta@concentric.net (Stan Brown)
Date: 1998/10/16
Raw View
[posted and emailed]

senthil@mediaone.net (senthil) wrote:

>Is Rational fractions implemented in STL(much like complex)?

No, standard C++ does not have any special operation for rationals.

I wondered why not, but I think I have the answer: Virtually every C++
programming textbook creates two sample classes, string and rational.
Since strings are now in the standard C++ library, the standards
committee had to throw a sop to all those textbook writers by leaving
them their only other example.  :-)

--
Stan Brown, Oak Road Systems, Cleveland, Ohio, USA
                      http://www.concentric.net/%7eBrownsta/
My reply address is correct as is. The courtesy of providing a correct
reply address is more important to me than time spent deleting spam.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: senthil <senthil@mediaone.net>
Date: 1998/10/15
Raw View
Hello there:
Is Rational fractions implemented in STL(much like complex)?
Senthil


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: stephen.clamage@sun.com (Steve Clamage)
Date: 1998/10/16
Raw View
senthil <senthil@mediaone.net> writes:


>Is Rational fractions implemented in STL(much like complex)?

No. The C++ standard library supports only the built-in
types and complex numbers. There may be third party
libraries that support rational numbers, but you'd have
to ask that in another newsgroup.

--
Steve Clamage, stephen.clamage@sun.com


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]