From 8e82b0429ed0fbd5049d48446da29a1fa55d5907 Mon Sep 17 00:00:00 2001 From: cookedm Date: Fri, 14 Dec 2007 22:19:54 +0000 Subject: Add degrees() and radians() ufuncs --- numpy/core/src/umathmodule.c.src | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'numpy/core/src/umathmodule.c.src') diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src index 5e24d89a8..ec531e0e5 100644 --- a/numpy/core/src/umathmodule.c.src +++ b/numpy/core/src/umathmodule.c.src @@ -413,6 +413,25 @@ rint (double x) #define isfinitef(x) (!(isinff((x)) || isnanf((x)))) #define isfinitel(x) (!(isinfl((x)) || isnanl((x)))) +float degreesf(float x) { + return x * (float)(180.0/M_PI); +} +double degrees(double x) { + return x * (180.0/M_PI); +} +longdouble degreesl(longdouble x) { + return x * (180.0L/M_PI); +} + +float radiansf(float x) { + return x * (float)(M_PI/180.0); +} +double radians(double x) { + return x * (M_PI/180.0); +} +longdouble radiansl(longdouble x) { + return x * (M_PI/180.0L); +} /* First, the C functions that do the real work */ -- cgit v1.2.1