/*
|
/*
|
* fp.h -- floating point arithmetic
|
* fp.h -- floating point arithmetic
|
*/
|
*/
|
|
|
|
|
typedef enum {
|
typedef enum {
|
false, true
|
false, true
|
} bool;
|
} bool;
|
|
|
typedef unsigned int tetra;
|
typedef unsigned int tetra;
|
|
|
typedef struct {
|
typedef struct {
|
tetra h, l;
|
tetra h, l;
|
} octa;
|
} octa;
|
|
|
typedef enum {
|
typedef enum {
|
zro, num, inf, nan
|
zro, num, inf, nan
|
} ftype;
|
} ftype;
|
|
|
|
|
octa oplus (octa, octa);
|
octa oplus (octa, octa);
|
octa ominus (octa, octa);
|
octa ominus (octa, octa);
|
octa incr (octa, int);
|
octa incr (octa, int);
|
octa shift_left (octa, int);
|
octa shift_left (octa, int);
|
octa shift_right (octa, int, int);
|
octa shift_right (octa, int, int);
|
octa omult (octa, octa);
|
octa omult (octa, octa);
|
octa signed_omult (octa, octa);
|
octa signed_omult (octa, octa);
|
octa odiv (octa, octa, octa);
|
octa odiv (octa, octa, octa);
|
octa signed_odiv (octa, octa);
|
octa signed_odiv (octa, octa);
|
octa oand (octa, octa);
|
octa oand (octa, octa);
|
octa oandn (octa, octa);
|
octa oandn (octa, octa);
|
octa oxor (octa, octa);
|
octa oxor (octa, octa);
|
int count_bits (tetra);
|
int count_bits (tetra);
|
tetra byte_diff (tetra, tetra);
|
tetra byte_diff (tetra, tetra);
|
tetra wyde_diff (tetra, tetra);
|
tetra wyde_diff (tetra, tetra);
|
octa bool_mult (octa, octa, bool);
|
octa bool_mult (octa, octa, bool);
|
octa fpack (octa, int, char, int);
|
octa fpack (octa, int, char, int);
|
tetra sfpack (octa, int, char, int);
|
tetra sfpack (octa, int, char, int);
|
ftype funpack (octa, octa *, int *, char *);
|
ftype funpack (octa, octa *, int *, char *);
|
ftype sfunpack (tetra, octa *, int *, char *);
|
ftype sfunpack (tetra, octa *, int *, char *);
|
octa load_sf (tetra);
|
octa load_sf (tetra);
|
tetra store_sf (octa);
|
tetra store_sf (octa);
|
octa fmult (octa, octa);
|
octa fmult (octa, octa);
|
octa fdivide (octa, octa);
|
octa fdivide (octa, octa);
|
octa fplus (octa, octa);
|
octa fplus (octa, octa);
|
int fepscomp (octa, octa, octa, int);
|
int fepscomp (octa, octa, octa, int);
|
void print_float (octa);
|
void print_float (octa);
|
int scan_const (char *);
|
int scan_const (char *);
|
int fcomp (octa, octa);
|
int fcomp (octa, octa);
|
octa fintegerize (octa, int);
|
octa fintegerize (octa, int);
|
octa fixit (octa, int);
|
octa fixit (octa, int);
|
octa floatit (octa, int, int, int);
|
octa floatit (octa, int, int, int);
|
octa froot (octa, int);
|
octa froot (octa, int);
|
octa fremstep (octa, octa, int);
|
octa fremstep (octa, octa, int);
|
|
|