Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 909 Bytes

mathematics.md

File metadata and controls

57 lines (37 loc) · 909 Bytes

Mathematics helpers

Arithmetic operations

import { ArithmeticOperations, arithmeticOperations } from '@drzioner/helpers';

const result = arithmeticOperations([2, 1, 4, 3], ArithmeticOperations.SUM);
#const result = arithmeticOperations([2, 1, 4, 3], 'sum');

console.log('result', result);

# result 10

Sum

import { sum } from '@drzioner/helpers';

const result = sum(1, 2);

console.log('result', result);

# result 3

Subtraction

import { subtraction } from '@drzioner/helpers';

const result = subtraction(1, 2);

console.log('result', result);

# result -1

Multiplication

import { multiplication } from '@drzioner/helpers';

const result = multiplication(1, 2);

console.log('result', result);

# result 2

Division

import { division } from '@drzioner/helpers';

const result = division(2, 1);

console.log('result', result);

# result 2