Fixed negative number issue

This commit is contained in:
Vera Lewis
2024-03-27 04:30:17 -05:00
parent fa90ad17db
commit 92eda19bdd
3 changed files with 298 additions and 0 deletions

36
src/ee.h Normal file
View File

@@ -0,0 +1,36 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
const int ERR_NS_OPERANDS = 1;
const int ERR_NS_OPERATORS = 2;
const int ERR_INVALID_INPUT = 4;
const int ERR_INVALID_FACTORIAL = 8;
struct EE_STACK_NODE {
double datum;
struct EE_STACK_NODE* tail;
};
typedef struct EE_STACK_NODE NODE;
typedef struct EE_STACK_NODE* STACK;
void push(double,STACK*);
void pop(STACK*);
double peek(STACK*);
int isNum(const char*);
int arrity(const char);
double evaluate(STACK*, char);
double* operands(STACK*, int);
double fact(int n);
void report(STACK*,char*);