MathOperator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RicardoSantos

//@version=5

// @description Methods to handle operators.
library(title='MathOperator')

//#region   Arithmetic:

// @function Add value a to b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns float.
export method add (float value_a, float value_b) =>
    value_a + value_b


// @function subtract value b from a.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns float.
export method subtract (float value_a, float value_b) =>
    value_a - value_b


// @function multiply value a with b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns float.
export method multiply (float value_a, float value_b) =>
    value_a * value_b


// @function divide value a with b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns float.
export method divide (float value_a, float value_b) =>
    value_a / value_b


// @function remainder of a with b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns float.
export method remainder (float value_a, float value_b) =>
    value_a % value_b

//#endregion
//#region   Comparison:

// @function equality of value a with b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns bool.
export method equal (float value_a, float value_b) =>
    value_a == value_b


// @function inequality of value a with b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns bool.
export method not_equal (float value_a, float value_b) =>
    value_a != value_b


// @function value a is over b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns bool.
export method over (float value_a, float value_b) =>
    value_a > value_b


// @function value a is under b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns bool.
export method under (float value_a, float value_b) =>
    value_a < value_b


// @function value a is over equal b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns bool.
export method over_equal (float value_a, float value_b) =>
    value_a >= value_b


// @function value a is under equal b.
// @param value_a float, value a.
// @param value_b float, value b.
// @returns bool.
export method under_equal (float value_a, float value_b) =>
    value_a <= value_b

//#endregion
//#region   Unity

// @function logical and of a with b
// @param value_a bool, value a.
// @param value_b bool, value b.
// @returns bool.
export method and_ (bool value_a, bool value_b) =>
    value_a and value_b


// @function logical or of a with b.
// @param value_a bool, value a.
// @param value_b bool, value b.
// @returns bool.
export method or_ (bool value_a, bool value_b) =>
    value_a or value_b

//#endregion