aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielheres <none@none>2010-12-22 20:13:21 -0800
committerdanielheres <none@none>2010-12-22 20:13:21 -0800
commit5d6b916c529e75bfaea1d7d0b36bd7187574fd6b (patch)
tree642461f4bc738f56c89c48182216be8d22ec0fcf
parent60cdfa59ed4eeefdfbe150933df67c21406e1247 (diff)
copysign and hypot in library
-rw-r--r--src/library.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index ddb90675..c8c33709 100644
--- a/src/library.js
+++ b/src/library.js
@@ -602,6 +602,15 @@ var Library = {
return isNaN(x);
},
+ copysign: function(a, b) {
+ if (a<0 === b<0) return a;
+ return -a;
+ },
+
+ hypot: function(a, b) {
+ return Math.sqrt(a*a + b*b);
+ },
+
// unistd.h
sysconf: function(name_) {