math_bits.cpp File Reference

#include "math_bits.h"
#include <basis/istring.h>

Include dependency graph for math_bits.cpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

istring crop_numeric (const istring &input)
 Eats the numeric characters from the front of "input".
istring crop_non_numeric (const istring &input)
 Eats the non-numeric characters from the front of "input".


Function Documentation

istring crop_non_numeric ( const istring input  ) 

Eats the non-numeric characters from the front of "input".

Definition at line 36 of file math_bits.cpp.

References istring::length(), and istring::zap().

Referenced by geometric::rectangle< numeric_type >::from_text(), and geometric::point< numeric_type >::from_text().

istring crop_numeric ( const istring input  ) 

Eats the numeric characters from the front of "input".

This and crop_non_numeric() return a string that is constructed from "input" by chopping the numerical (or non-numerical) characters off of the beginning. The types of numbers supported are floating point, but it will generally work for integers also (problems arise when mixing in the period, e, E, +, and - characters with integer numbers).

Definition at line 22 of file math_bits.cpp.

References istring::length(), and istring::zap().

Referenced by geometric::rectangle< numeric_type >::from_text(), and geometric::point< numeric_type >::from_text().


Generated on Fri Nov 28 04:30:05 2008 for HOOPLE Libraries by  doxygen 1.5.1