Sindbad~EG File Manager

Current Path : /usr/home/beeson/MathXpert/var/
Upload File :
Current File : /usr/home/beeson/MathXpert/var/const8.c

/* M. Beeson, for Mathpert
Declaration and initialization of constant terms
*/
/*
6.30.94 extracted from old files
4.17.95 code last modified
1.30.98 modified
8.19.07 added eulergamma
2.6.07 made the arrays longer so there's spare space at the end
*/

#include <assert.h>

#include "terms.h"
#include "constant.h"
/*_______________________________________________________________________*/
static double const constvals[10] = {E_DECIMAL,0.0,PI_DECIMAL,0.0,1.0,0.0, EULERGAMMA_DECIMAL, 0.0,0.0,0.0};

 /* where the value pointers of e,pi_term, and i point */
 /* two doubles for each of the three */

static const long intvals[MAXCONSTANTINT+2] = { 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L};
/* for the values of one, two, ... */

const term zero =  {0,1,AE_BIT | INTEGER,(void *)intvals};
const term one =   {0,1,AE_BIT | INTEGER,(void *)(intvals+1)};
const term two =   {0,1,AE_BIT | INTEGER,(void *)(intvals+2)};
const term three = {0,1,AE_BIT | INTEGER,(void *)(intvals+3)};
const term four =  {0,1,AE_BIT | INTEGER,(void *)(intvals+4)};
const term five =  {0,1,AE_BIT | INTEGER,(void *)(intvals+5)};
const term six =   {0,1,AE_BIT | INTEGER,(void *)(intvals+6)};
const term seven = {0,1,AE_BIT | INTEGER,(void *)(intvals+7)};
const term eight = {0,1,AE_BIT | INTEGER,(void *)(intvals+8)};
const term nine =  {0,1,AE_BIT | INTEGER,(void *)(intvals+9)};
const term ten =   {0,1,AE_BIT | INTEGER,(void *)(intvals+10)};
const term falseterm = {FALSEFUNCTOR,0,0,0};
const term trueterm  = {TRUEFUNCTOR,0,0,0};
const term infinity = {INFINITYFUNCTOR,0,0,0};
const term tiny     = {TINY,0,0,0};
const term minusinfinity = { '-',1,NOTYPE,(void *)&infinity};
const term minusone = { '-',1, AE_BIT | INTEGER,(void *)&one};
const term complexi = { 'i',0, CE_BIT | GAUSSIAN,(void *)(constvals+4)};
const term eulere   = { 'e',0, R,(void *) constvals};
const term eulergamma = { EULERGAMMA, 0,R, (void *) (constvals+6)};
const term pi_term = {PI_ATOM, 0, R, (void *)(constvals+2)};
term const piover2args[2] = {{PI_ATOM, 0, R,(void *)(constvals+2)},{0,1,AE_BIT | INTEGER,(void *)(intvals+2)}};
term const piover3args[2] = {{PI_ATOM, 0, R, (void *)(constvals+2)},{0,1,AE_BIT | INTEGER,(void *)(intvals+3)}};
const term piover2 = {'/',2,R,(void *) piover2args};
const term piover3 = {'/',2,R,(void *) piover3args};
const term var0 = {VAR,0,META_BIT, 0};
const term var1 = {VAR,0,META_BIT | 1,0};
const term right = {RIGHT,0,0,0};  /* for one-sided limit terms */
const term left = {LEFT,0,0,0};
const term undefined = {UNDEFINED,0,0,0};
const term unbounded_oscillations = {UNBOUNDED_OSCILLATIONS,0,0,0};
const term bounded_oscillations = {BOUNDED_OSCILLATIONS,0,0,0};

/*____________________________________________________________________*/
term constant_int( int i)
{ switch(i)
     { case 0: return zero;
       case 1: return one;
       case 2: return two;
       case 3: return three;
       case 4: return four;
       case 5: return five;
       case 6: return six;
       case 7: return seven;
       case 8: return eight;
       case 9: return nine;
       case 10: return ten;
       default: assert(0);
     }
  return zero;   /* avoid a warning message */
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists