OSDN Git Service
(root)
/
sie
/
sie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad0fb01
)
Add a Math.cbrt function
author
dhrname
<dhrname@users.sourceforge.jp>
Thu, 26 Mar 2015 14:30:49 +0000
(23:30 +0900)
committer
dhrname
<dhrname@users.sourceforge.jp>
Thu, 26 Mar 2015 14:30:49 +0000
(23:30 +0900)
org/w3c/dom/smil.js
patch
|
blob
|
history
diff --git
a/org/w3c/dom/smil.js
b/org/w3c/dom/smil.js
index
924c3a1
..
02b9973
100644
(file)
--- a/
org/w3c/dom/smil.js
+++ b/
org/w3c/dom/smil.js
@@
-607,4
+607,14
@@
base("$from").of( {
}
\r
}
\r
} ).to = base("$from").$to;
\r
+
\r
+/*ニュートン・ラフソン法により立方根(3乗根)を求める。Math.powだと負の値に対応していないため
\r
+ * なお、ソースコードの著作権は Tomy氏が持っている(tomy@tk.airnet.ne.jp)
\r
+ * http://www5.airnet.ne.jp/tomy/cpro/sslib3.htm*/
\r
+Math.cbrt = function (a) {
\r
+ if(a == 0.) return 0.;
\r
+ var w = Math.pow(Math.abs(a), 1./ 3.);
\r
+ if(a < 0.) w = -w;
\r
+ return (w + 3. * a / (2. * w * w + a / w)) / 2.;
\r
+};
\r
//#endif // _SMIL_IDL_
\r