@aceworks-studio/math

0.1.1 • Public • Published

checks version GitHub top language license npm

@aceworks-studio/math

A set of utility functions related to math or numbers.

Installation

Add @aceworks-studio/math in your dependencies:

yarn add @aceworks-studio/math

Or if you are using npm:

npm install @aceworks-studio/math

Content

isFinite

function isFinite(value: number): boolean

Returns true if the number not equal to infinity (or negative infinity) or NaN.

isInteger

function isInteger(value: number): boolean

Returns true if the number is finite and a whole number (no decimal part).

isSafeInteger

function isSafeInteger(value: number): boolean

Returns true if the number is finite, a whole number (no decimal part) and no other number rounds to it.

isNaN

function isNaN(value: number): boolean

Returns true if the number is NaN.

lerp

function lerp(initialValue: number, finalValue: number, alpha: number): number

Returns a number interpolated between an initial value and a final value using a number alpha between 0 and 1.

round

function round(value: number, decimals: number?): number

Returns a number rounded with the given decimals, or rounded to the nearest integer.

License

This project is available under the MIT license. See LICENSE.txt for details.

Other Lua Environments Support

If you would like to use this library on a Lua environment where it is currently incompatible, open an issue (or comment on an existing one) to request the appropriate modifications.

The library uses darklua to process its code.

Readme

Keywords

Package Sidebar

Install

npm i @aceworks-studio/math

Weekly Downloads

4

Version

0.1.1

License

MIT

Unpacked Size

4.82 kB

Total Files

10

Last publish

Collaborators

  • jeparlefrancais