summaryrefslogtreecommitdiff
path: root/src/func.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-09 02:29:24 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-09 02:29:24 (GMT)
commit23f6b0623c86eba96dfb1296b862522cf02b0734 (patch)
tree998500ef16763f6f08f9f7cb8917c98b1643af68 /src/func.cc
parent52dfffd97ba49b603b4814d843cd9be08d040364 (diff)
parent5044ea928d72da800d11b2b80f6148265c13d10f (diff)
Merge branch 'master' into threading
Conflicts: RELEASE_NOTES
Diffstat (limited to 'src/func.cc')
-rw-r--r--src/func.cc18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/func.cc b/src/func.cc
index 1138173..6686cb9 100644
--- a/src/func.cc
+++ b/src/func.cc
@@ -96,24 +96,14 @@ std::string BuiltinFunction::dump(const std::string &indent, const std::string &
return dump.str();
}
-static double deg2rad(double x)
+static inline double deg2rad(double x)
{
- while (x < 0.0)
- x += 360.0;
- while (x >= 360.0)
- x -= 360.0;
- x = x * M_PI * 2.0 / 360.0;
- return x;
+ return x * M_PI / 180.0;
}
-static double rad2deg(double x)
+static inline double rad2deg(double x)
{
- x = x * 360.0 / (M_PI * 2.0);
- while (x < 0.0)
- x += 360.0;
- while (x >= 360.0)
- x -= 360.0;
- return x;
+ return x * 180.0 / M_PI;
}
Value builtin_abs(const Context *, const std::vector<std::string>&, const std::vector<Value> &args)
contact: Jan Huwald // Impressum