@honux/mathf
Version:
JavaScript library that provides constants and static methods for common mathematical functions
33 lines (22 loc) • 823 B
Markdown
# MathF.js
MathF is a JavaScript library that provides constants and static methods for common mathematical functions.
## Install
```
npm install /mathf
```
## Quick Start
```javascript
const { Mathf } = require('@honux/mathf');
console.log(Mathf.PI);
console.log(Mathf.isEven(2));
console.log(Mathf.isOdd(2));
```
## Methods
- IsOdd(num) : return true if num is a odd number
- IsEven(num) : return true if num is a even number
## Value
- PI : Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.
- E : Represents the natural logarithmic base, specified by the constant, e.
- Tau : 2 * PI
## Reference
- This project is inspired by [MathF class of .NET](https://docs.microsoft.com/en-us/dotnet/api/system.mathf?view=net-5.0).