The Math Library

Up: GEOS SDK TechDocs | Up | Down | Next: 1 Basic Math Functions
| One-page Version of this Chapter for Easy Printing

The Math Library allows high precision computations not available through standard integer operations. Floating Point (FP) numbers use decimal representation to express fractional quantities. This format also allows scientific notation to represent very large and very small numbers.

To enable floating point operations, an application must include a GEOS Math Library. There are two Math Libraries: math.h and math.goh . The file math.h includes what you need to get floating point numbers to work within your application. The object file, math.goh (which includes math.h ), includes the float-format controller, an object that allows the user to control how floating point numbers are formatted within an application.

In most cases, the mere inclusion of the Math Library will eliminate the need to directly call Math Library routines. (The C compiler will parse the mathematical expressions into appropriate floating point routines.) You may, however, wish to call some of these routines directly. Developers using Object Assembly must use this latter approach. C developers may also want to directly manipulate the FP stack for involved computations that they would rather not leave to the compiler. This approach is discussed in the latter half of this chapter.

Use of math.goh is optional, depending on the purpose of the application. A spreadsheet application, for example, might want to allow the user to format FP numbers. Other applications might not want to include this file.


Up: GEOS SDK TechDocs | Up | Down | Next: 1 Basic Math Functions
| One-page Version of this Chapter for Easy Printing