Skip to content

Commit

Permalink
add "inf" "isnan" "isinf"
Browse files Browse the repository at this point in the history
  • Loading branch information
KedamaOvO committed Dec 17, 2018
1 parent 24a2377 commit 3f97cbd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions html/js/rtppd/Formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Formatter {
tuple.objectsCount,
tuple.time,
tuple.duration,
//funtion
//function
(name, val) => this._set(name, val)
);
break;
Expand Down Expand Up @@ -147,6 +147,7 @@ class Formatter {

window["pi"] = Math.PI;
window["e"] = Math.E;
window["inf"] = Number.POSITIVE_INFINITY;

window["sin"] = Math.sin;
window["cos"] = Math.cos;
Expand All @@ -172,4 +173,6 @@ window["lerp"] = (a, b, t) => (1 - t) * a + t * b;
window["random"] = (a, b) => (a || 0) + Math.random() * ((b || 1) - (a || 0));
window["getTime"] = () => new Date().getTime();
window["mod"] = (a, b) => a % b;
window["_if"] = (cond, a, b) => cond ? a : b;
window["_if"] = (cond, a, b) => cond ? a : b;
window["isnan"] = Number.isNaN;
window["isinf"] = (a) => a == Number.NEGATIVE_INFINITY || a == Number.POSITIVE_INFINITY;

0 comments on commit 3f97cbd

Please sign in to comment.