| File lib/felix/lib/flx_gmp.flx |
GODI Package
apps-felix |
// THIS WRAPPER IS FFAU .. it is NOT LGPL licenced
// This is because the wrapper was hand written from
// scratch .. it was NOT derived from any LGPL headers
// Code LINKED against libgmp, however, may be governed
// by the LGPL licence, since the object files ARE
// derived from gmp.h
header "#include <cstdio>";
header "#include <gmpxx.h>";
module Gmp
{
type mpz='mpz_class';
type mpq='mpq_class';
type mpf='mpf_class';
fun add:mpz*mpz->mpz="$1+$2";
fun sub:mpz*mpz->mpz="$1-$2";
fun mul:mpz*mpz->mpz="$1*$2";
fun div:mpz*mpz->mpz="$1/$2";
proc print:mpz="cout << $1;";
fun add:mpq*mpq->mpq="$1+$2";
fun sub:mpq*mpq->mpq="$1-$2";
fun mul:mpq*mpq->mpq="$1*$2";
fun div:mpq*mpq->mpq="$1/$2";
proc print:mpq="cout << $1;";
fun add:mpf*mpf->mpf="$1+$2";
fun sub:mpf*mpf->mpf="$1-$2";
fun mul:mpf*mpf->mpf="$1*$2";
fun div:mpf*mpf->mpf="$1/$2";
proc print:mpf="cout << $1;";
}