initial commit
This commit is contained in:
14
node_modules/mumath/clamp.js
generated
vendored
Normal file
14
node_modules/mumath/clamp.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Clamp value.
|
||||
* Detects proper clamp min/max.
|
||||
*
|
||||
* @param {number} a Current value to cut off
|
||||
* @param {number} min One side limit
|
||||
* @param {number} max Other side limit
|
||||
*
|
||||
* @return {number} Clamped value
|
||||
*/
|
||||
'use strict';
|
||||
module.exports = function(a, min, max){
|
||||
return max > min ? Math.max(Math.min(a,max),min) : Math.max(Math.min(a,min),max);
|
||||
};
|
||||
Reference in New Issue
Block a user