// floating.h // // by John D. de Boer typedef /*long*/ double real; // Utility functions real modtwopi(real X); real modtwopisym(real X); real fgtr(real X, real Lower); real flsr(real X, real Upper); real fbetween(real X, real Lower, real Upper); real rounddown(real X, bool Two, bool Five); // Floating-point string functions string floatstring(real Num, int PLACES, short *EXP); string engineeringrep(real Num, int PLACES, short *EXP); string fixedstring(real Num, int LEFT, int RIGHT); bool parsereal(const char *S, real *X); bool modalreal(const char *Msg, char **S, real *X); // Decimal strings with SI units string sifloat(real Num, int PLACES, short *EXP, char *Pref, char *Units); // Angle string functions bool parsedegrees(const char *S, real *Rads); bool parsedegminsec(const char *S, real *Rads); bool parsehourminsec(const char *S, real *Rads); string anglestring(real Angle, bool Radians); string degminstring(real Angle, bool Pos); // Drawing real numbers //void drawreal(real X, int PLACES); //void drawfixed(real X, int LEFT, int RIGHT); // Reading and writing real numbers void writereal(real X); real readreal(void);