Next: Arithmetic Operations for mytype
Up: Data Manipulations
Previous: Data Manipulations
For number assignments, one cannot use such expressions as x=(mytype)a.
This is because cddlib uses an abstract number type (mytype)
so that it can compute with various
number types such as C double and GMP rational.
User can easily add a new number type by redefining
arithmetic operations in cddmp.h and cddmp.c.
- void dd_init(x)
- :
This is to initialize a mytype variable x and to set it
to zero. This initialization has to be called before
any mytype variable to be used.
- void dd_clear(x)
- :
This is to free the space allocated to a mytype variable x.
- void dd_set_si(x, a)
- :
This is to set a mytype variable x to the
value of signed long integer a.
- void dd_set_si2(x, a, b)
- :
This is to set a mytype variable x to the
value of the rational expression a/b, where
a is signed long and b is unsigned long
integers.
- void dd_set_d(x, b)
- :
This is to set a mytype variable x to the
value of double b. This is available only
when the library is compiled without -DGMPRATIONAL
compiler option.
Next: Arithmetic Operations for mytype
Up: Data Manipulations
Previous: Data Manipulations
Komei Fukuda
2004-11-24