wcalc  2.5
About: Wcalc is a natural-expression command-line calculator.
  Fossies Dox: wcalc-2.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

calculator.h File Reference
#include "definitions.h"
#include "number.h"
Include dependency graph for calculator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _conf
 

Macros

#define Dprintf(...)   ;
 
#define DECIMAL_FORMAT   0
 
#define OCTAL_FORMAT   1
 
#define HEXADECIMAL_FORMAT   2
 
#define BINARY_FORMAT   3
 
#define NO_ROUNDING_INDICATION   0
 
#define SIMPLE_ROUNDING_INDICATION   1
 
#define SIG_FIG_ROUNDING_INDICATION   2
 

Enumerations

enum  functions {
  wnot, wbnot, wsin, wcos,
  wtan, wcot, wsec, wcsc,
  wasin, wacos, watan, wacot,
  wasec, wacsc, wsinh, wcosh,
  wtanh, wcoth, wsech, wcsch,
  wasinh, wacosh, watanh, wacoth,
  wasech, wacsch, wlog, wlogtwo,
  wln, wround, wneg, wabs,
  wsqrt, wfloor, wceil, wrand,
  wirand, wexp, wfact, wcomp,
  weint, wgamma, wlngamma, wzeta,
  wsinc, wcbrt
}
 
enum  operations {
  wplus, wminus, wmult, wdiv,
  wmod, wpow, wor, wbor,
  wbxor, wand, wband, wequal,
  wnequal, wgt, wlt, wrshft,
  wlshft, wgeq, wleq, wnone
}
 
enum  commands { redisplay, nothing }
 
enum  engineering_modes { always, never, automatic }
 

Functions

void parseme (const char *)
 
void report_error (const char *fmt,...)
 
void set_prettyanswer (const mpfr_t num)
 
char * print_this_result (const mpfr_t result, int output, char *nad, char **es)
 
void uber_function (mpfr_t output, const enum functions func, mpfr_t input)
 
void simple_exp (mpfr_t output, const mpfr_t first, const enum operations op, const mpfr_t second)
 
int seed_random (void)
 
char * output_string (const unsigned int)
 

Variables

struct _conf conf
 
mpfr_t last_answer
 
char * pretty_answer
 
char compute
 
unsigned int sig_figs
 
char standard_output
 
char not_all_displayed
 

Macro Definition Documentation

◆ BINARY_FORMAT

#define BINARY_FORMAT   3

Definition at line 166 of file calculator.h.

◆ DECIMAL_FORMAT

#define DECIMAL_FORMAT   0

Definition at line 163 of file calculator.h.

◆ Dprintf

#define Dprintf (   ...)    ;

Definition at line 23 of file calculator.h.

◆ HEXADECIMAL_FORMAT

#define HEXADECIMAL_FORMAT   2

Definition at line 165 of file calculator.h.

◆ NO_ROUNDING_INDICATION

#define NO_ROUNDING_INDICATION   0

Definition at line 168 of file calculator.h.

◆ OCTAL_FORMAT

#define OCTAL_FORMAT   1

Definition at line 164 of file calculator.h.

◆ SIG_FIG_ROUNDING_INDICATION

#define SIG_FIG_ROUNDING_INDICATION   2

Definition at line 170 of file calculator.h.

◆ SIMPLE_ROUNDING_INDICATION

#define SIMPLE_ROUNDING_INDICATION   1

Definition at line 169 of file calculator.h.

Enumeration Type Documentation

◆ commands

enum commands
Enumerator
redisplay 
nothing 

Definition at line 100 of file calculator.h.

◆ engineering_modes

Enumerator
always 
never 
automatic 

Definition at line 102 of file calculator.h.

◆ functions

enum functions
Enumerator
wnot 
wbnot 
wsin 
wcos 
wtan 
wcot 
wsec 
wcsc 
wasin 
wacos 
watan 
wacot 
wasec 
wacsc 
wsinh 
wcosh 
wtanh 
wcoth 
wsech 
wcsch 
wasinh 
wacosh 
watanh 
wacoth 
wasech 
wacsch 
wlog 
wlogtwo 
wln 
wround 
wneg 
wabs 
wsqrt 
wfloor 
wceil 
wrand 
wirand 
wexp 
wfact 
wcomp 
weint 
wgamma 
wlngamma 
wzeta 
wsinc 
wcbrt 

Definition at line 29 of file calculator.h.

◆ operations

enum operations
Enumerator
wplus 
wminus 
wmult 
wdiv 
wmod 
wpow 
wor 
wbor 
wbxor 
wand 
wband 
wequal 
wnequal 
wgt 
wlt 
wrshft 
wlshft 
wgeq 
wleq 
wnone 

Definition at line 77 of file calculator.h.

Function Documentation

◆ output_string()

char* output_string ( const unsigned int  )

Definition at line 1380 of file calculator.c.

References BINARY_FORMAT, DECIMAL_FORMAT, HEXADECIMAL_FORMAT, and OCTAL_FORMAT.

Referenced by display_prefs().

◆ parseme()

◆ print_this_result()

char* print_this_result ( const mpfr_t  result,
int  output,
char *  nad,
char **  es 
)

◆ report_error()

void report_error ( const char *  fmt,
  ... 
)

◆ seed_random()

int seed_random ( void  )

◆ set_prettyanswer()

void set_prettyanswer ( const mpfr_t  num)

◆ simple_exp()

void simple_exp ( mpfr_t  output,
const mpfr_t  first,
const enum operations  op,
const mpfr_t  second 
)

◆ uber_function()

void uber_function ( mpfr_t  output,
const enum functions  func,
mpfr_t  input 
)

Variable Documentation

◆ compute

char compute

Definition at line 102 of file calculator.c.

Referenced by parseme(), simple_exp(), uber_function(), and yyparse().

◆ conf

◆ last_answer

◆ not_all_displayed

char not_all_displayed

Definition at line 107 of file calculator.c.

Referenced by print_this_result(), and print_this_result_dbl().

◆ pretty_answer

char* pretty_answer

◆ sig_figs

unsigned int sig_figs

Definition at line 103 of file calculator.c.

Referenced by parseme(), print_this_result(), print_this_result_dbl(), and yylex().

◆ standard_output