summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tibtype.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/tibtype.c b/src/tibtype.c
index 45bbce0..1351dec 100644
--- a/src/tibtype.c
+++ b/src/tibtype.c
@@ -1103,25 +1103,12 @@ tib_factorial (const TIB *t)
TIB *
tib_toradians (const TIB *t)
{
- TIB *pi = tib_var_get (TIB_CHAR_PI);
- if (!pi)
- return NULL;
-
- TIB *factor = tib_new_complex (180, 0);
+ TIB *factor = tib_new_complex (3.141592653589793238462643383279502884 / 180,
+ 0);
if (!factor)
- {
- tib_decref (pi);
- return NULL;
- }
-
- TIB *temp = tib_div (pi, factor);
- tib_decref (pi);
- tib_decref (factor);
- if (!temp)
return NULL;
- factor = temp;
- temp = tib_mul (t, factor);
+ TIB *temp = tib_mul (t, factor);
tib_decref (factor);
return temp;