basix_doc 0.1
|
/****************************************************************************** * MODULE : string_test.cpp * DESCRIPTION: Test strings * COPYRIGHT : (C) 2003 Joris van der Hoeven ******************************************************************************* * This software falls under the GNU general public license and comes WITHOUT * ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details. * If you don't have this file, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ******************************************************************************/ #include <basix/port.hpp> using mmx::string; using namespace mmx; /* void scnot_test (const string& s1, const string& s2) { mmout << s1 << ",\t" << s2 << "\t->\t" << make_range (s1, s2) << "\n"; } */ int main () { string x ("Hi"); string y ("There"); mmout << "x\t= " << x << "\n"; mmout << "y\t= " << y << "\n"; mmout << "x*y\t= " << (x*y) << "\n"; x << y; mmout << "-> x << y\n"; mmout << "x\t= " << x << "\n"; x << y; mmout << "-> x << y\n"; mmout << "x\t= " << x << "\n"; mmout << "x=y\t= " << (x==y) << "\n"; mmout << "x!=y\t= " << (x!=y) << "\n"; mmout << "x<y\t= " << (x<y) << "\n"; mmout << "x<=y\t= " << (x<=y) << "\n"; mmout << "x>y\t= " << (x>y) << "\n"; mmout << "x>=y\t= " << (x>=y) << "\n\n"; mmout << "1\t= " << as_int ("1") << "\n"; mmout << "-1\t= " << as_int ("-1") << "\n"; mmout << "1.0\t= " << as_double ("1.0") << "\n"; mmout << "-1.0\t= " << as_double ("-1.0") << "\n"; mmout << "1.0e2\t= " << as_double ("1.0e2") << "\n"; mmout << "-1.0e2\t= " << as_double ("-1.0e2") << "\n"; mmout << "1.0E-2\t= " << as_double ("1.0E-2") << "\n"; mmout << "-1.0E-2\t= " << as_double ("-1.0E-2") << "\n\n"; /* scnot_test ("-infty", "-infty"); scnot_test ("1.23", "1.2345"); scnot_test ("1.223", "1.234"); scnot_test ("1.4999", "1.5067"); scnot_test ("1.4999", "1.5003"); scnot_test ("3.2", "infty"); scnot_test ("-3.2", "-3.1"); scnot_test ("0", "8e3"); scnot_test ("9.99e3", "1.004e4"); scnot_test ("-3.0e8", "3.1e7"); scnot_test ("1.578", "3.259"); scnot_test ("11.578", "11.789"); scnot_test ("11.578", "11.579"); scnot_test ("19992", "19997"); scnot_test ("9992", "9997"); scnot_test ("99922", "99927"); scnot_test ("39952", "39957"); scnot_test ("infty", "infty"); scnot_test ("-infty", "++infty"); scnot_test ("-Infty", "-Infty"); */ return 0; }