mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 12:33:38 +00:00
23 lines
618 B
JavaScript
23 lines
618 B
JavaScript
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
*/
|
|
|
|
/**
|
|
* Calculates the positive difference of two given numbers.
|
|
*
|
|
* @function Phaser.Math.Difference
|
|
* @since 3.0.0
|
|
*
|
|
* @param {number} a - The first number in the calculation.
|
|
* @param {number} b - The second number in the calculation.
|
|
*
|
|
* @return {number} The positive difference of the two given numbers.
|
|
*/
|
|
var Difference = function (a, b)
|
|
{
|
|
return Math.abs(a - b);
|
|
};
|
|
|
|
module.exports = Difference;
|