summaryrefslogtreecommitdiff
path: root/src/tibeval.c
diff options
context:
space:
mode:
authorDavid McMackins II <contact@mcmackins.org>2016-09-02 07:12:03 -0500
committerDavid McMackins II <contact@mcmackins.org>2016-09-02 07:12:03 -0500
commit75b2534589ae75df3f63b3652283a9405be18314 (patch)
tree64d5dabd6ba366177f543fca2f33dd2851872570 /src/tibeval.c
parentb686ce8f91636d5318e98aec6e45866fec88b357 (diff)
Add degrees operator
Diffstat (limited to 'src/tibeval.c')
-rw-r--r--src/tibeval.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/tibeval.c b/src/tibeval.c
index 59deb3f..43c93f0 100644
--- a/src/tibeval.c
+++ b/src/tibeval.c
@@ -47,12 +47,13 @@ struct math_operator
static const struct math_operator OPERATORS[] =
{
- { { .t = tib_factorial }, T, '!', 0 },
- { { .tt = tib_pow }, TT, '^', 1 },
- { { .tt = tib_mul }, TT, '*', 2 },
- { { .tt = tib_div }, TT, '/', 2 },
- { { .tt = tib_add }, TT, '+', 3 },
- { { .tt = tib_sub }, TT, '-', 3 }
+ { { .t = tib_factorial }, T, '!', 0 },
+ { { .t = tib_toradians }, T, TIB_CHAR_DEGREE, 0 },
+ { { .tt = tib_pow }, TT, '^', 1 },
+ { { .tt = tib_mul }, TT, '*', 2 },
+ { { .tt = tib_div }, TT, '/', 2 },
+ { { .tt = tib_add }, TT, '+', 3 },
+ { { .tt = tib_sub }, TT, '-', 3 }
};
#define NUM_MATH_OPERATORS (sizeof OPERATORS / sizeof (struct math_operator))