HiveMind
Functions | Variables
BittyBuzzMathFunctions Namespace Reference

Provides math function for the standard lib provided with the vm see IBittyBuzzLib. In the buzz code, the functions are situated in the math namespace. More...

Functions

void abs ()
 Calculates the absolute value Signature abs(arg1) More...
 
void floori ()
 Floor a value Signature floori(arg1) More...
 
void floorf ()
 Floor a value Signature floorf(arg1) More...
 
void ceili ()
 Ceil a value Signature ceili(arg1) More...
 
void ceilf ()
 Ceil a value Signature ceilf(arg1) More...
 
void roundi ()
 Rounds a value Signature roundi(arg1) More...
 
void roundf ()
 Rounds a value Signature roundf(arg1) More...
 
void log ()
 Calculates the natural logarithm (ln) Signature log(arg1) More...
 
void log2 ()
 Calculates the logarithm base 2 Signature log2(arg1) More...
 
void log10 ()
 Calculates the logarithm base 10 Signature log10(arg1) More...
 
void pow ()
 Calculates the base raised to the power of the exponent. Signature pow(base, exponent) More...
 
void exp ()
 Calculates e^x Signature exp(x) More...
 
void sqrt ()
 Calculates the square root Signature sqrt(arg1) More...
 
void sin ()
 Calculates the sine Signature sin(arg1) More...
 
void cos ()
 Calculates the cosine Signature cos(arg1) More...
 
void tan ()
 Calculates the tengent Signature tan(arg1) More...
 
void asin ()
 Calculates the arc sine Signature asin(arg1) More...
 
void acos ()
 Calculates the arc cosine Signature acos(arg1) More...
 
void atan ()
 Calculates the arc cosine Signature atan(arg1) More...
 
void min ()
 Return the min Signature min(arg1, arg2) More...
 
void max ()
 Return the max Signature max(arg1, arg2) More...
 
void rng_uniform ()
 Return a number with a uniform distribution Signature rng_uniform() More...
 

Variables

const float E = Math::e
 The euleur number as a constant note that since buzz approximates ln(e) may not equal 1. More...
 
const float PI = Math::pi
 The value of PI as a constant note that since it approximates cos(pi) may not equal 0. More...
 

Detailed Description

Provides math function for the standard lib provided with the vm see IBittyBuzzLib. In the buzz code, the functions are situated in the math namespace.

Function Documentation

◆ abs()

void BittyBuzzMathFunctions::abs ( )

Calculates the absolute value Signature abs(arg1)

expect one argument

  1. the value to absolue, an int or a float returns the absolute value
    *assert_true(math.abs(-3), 3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ acos()

void BittyBuzzMathFunctions::acos ( )

Calculates the arc cosine Signature acos(arg1)

expect one argument

  1. the value to calculate the arc cosine, the value must be betwen [-1, +1] returns the arc cosine of the value in degrees
    *var acos_03 = math.acos(0.3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ asin()

void BittyBuzzMathFunctions::asin ( )

Calculates the arc sine Signature asin(arg1)

expect one argument

  1. the value to calculate the arc sine, the value must be betwen [-1, +1] returns the arc sine of the value in degrees
    *var asin_03 = math.asin(0.3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atan()

void BittyBuzzMathFunctions::atan ( )

Calculates the arc cosine Signature atan(arg1)

expect two arguments

  1. the value representing the y coordinate
  2. the value representing the x coordinate returns the arc tengent of y/x in degrees
    *var atan_03 = math.atan(0.3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ceilf()

void BittyBuzzMathFunctions::ceilf ( )

Ceil a value Signature ceilf(arg1)

expect one argument

  1. the value to ceil, an int or a float returns the ceil of a value as float
    *assert_true(math.ceilf(2.55), 3.0);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ceili()

void BittyBuzzMathFunctions::ceili ( )

Ceil a value Signature ceili(arg1)

expect one argument

  1. the value to ceil, an int or a float returns the ceil of a value as int
    *assert_true(math.ceili(2.55), 3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cos()

void BittyBuzzMathFunctions::cos ( )

Calculates the cosine Signature cos(arg1)

expect one argument

  1. the value to calculate the cosine, in degrees returns the cosine of the value
    *var cos_3 = math.cos(3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exp()

void BittyBuzzMathFunctions::exp ( )

Calculates e^x Signature exp(x)

expect one argument

  1. the value of the exponent returns the value of the exponent
    *var exp_3 = math.exp(3); # e³
Here is the call graph for this function:
Here is the caller graph for this function:

◆ floorf()

void BittyBuzzMathFunctions::floorf ( )

Floor a value Signature floorf(arg1)

expect one argument

  1. the value to floor, an int or a float returns the floor of a value as a float
    *assert_true(math.floorf(3.55), 3.0);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ floori()

void BittyBuzzMathFunctions::floori ( )

Floor a value Signature floori(arg1)

expect one argument

  1. the value to floor, an int or a float returns the floor of a value as a int
    *assert_true(math.floori(3.55), 3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log()

void BittyBuzzMathFunctions::log ( )

Calculates the natural logarithm (ln) Signature log(arg1)

expect one argument

  1. the value whose logaritm is calculated returns the natural logarithm of a value
    *var ln_3 = math.log(3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log10()

void BittyBuzzMathFunctions::log10 ( )

Calculates the logarithm base 10 Signature log10(arg1)

expect one argument

  1. the value whose logaritm is calculated returns the logarithm base 10 of a value
    *var log10_3 = math.log10(3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log2()

void BittyBuzzMathFunctions::log2 ( )

Calculates the logarithm base 2 Signature log2(arg1)

expect one argument

  1. the value whose logaritm is calculated returns the logarithm base 2 of a value
    *var log2_3 = math.log2(3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ max()

void BittyBuzzMathFunctions::max ( )

Return the max Signature max(arg1, arg2)

expect two arguments

  1. the first value
  2. the second value returns the max of the two arguments
    *assert_true(math.min(2,3), 3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ min()

void BittyBuzzMathFunctions::min ( )

Return the min Signature min(arg1, arg2)

expect two arguments

  1. the first value
  2. the second value returns the minimum of the two arguments
    *assert_true(math.min(2,3), 2);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pow()

void BittyBuzzMathFunctions::pow ( )

Calculates the base raised to the power of the exponent. Signature pow(base, exponent)

expect two argument

  1. the base
  2. the exponent returns the value of the power as a float even if the two numbers are ints
    *var pow = math.pow(2, 8); #256
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rng_uniform()

void BittyBuzzMathFunctions::rng_uniform ( )

Return a number with a uniform distribution Signature rng_uniform()

expects no arguments returns a random number, follows a uniform distribution

var random_number = math.rng_uniform();
Here is the call graph for this function:
Here is the caller graph for this function:

◆ roundf()

void BittyBuzzMathFunctions::roundf ( )

Rounds a value Signature roundf(arg1)

expect one argument

  1. the value to round, an int or a float returns the round of a value as float
    *assert_true(math.roundf(2.55), 3.0);
    *assert_true(math.roundf(2.45), 2.0);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ roundi()

void BittyBuzzMathFunctions::roundi ( )

Rounds a value Signature roundi(arg1)

expect one argument

  1. the value to round, an int or a float returns the round of a value as int
    *assert_true(math.roundi(2.55), 3);
    *assert_true(math.roundi(2.45), 2);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sin()

void BittyBuzzMathFunctions::sin ( )

Calculates the sine Signature sin(arg1)

expect one argument

  1. the value to calculate the sine, in degrees returns the sine of the value
    *var sin_3 = math.sin(3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sqrt()

void BittyBuzzMathFunctions::sqrt ( )

Calculates the square root Signature sqrt(arg1)

expect one argument

  1. the value to square root returns the value of the square root
    *var sqrt_3 = math.sqrt(3);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tan()

void BittyBuzzMathFunctions::tan ( )

Calculates the tengent Signature tan(arg1)

expect one argument

  1. the value to calculate the tengent, in degrees returns the tengent of the value
    *var tan_3 = math.tan(3);
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ E

const float BittyBuzzMathFunctions::E = Math::e

The euleur number as a constant note that since buzz approximates ln(e) may not equal 1.

*assert_true(math.ln(math.E) == 1);

◆ PI

const float BittyBuzzMathFunctions::PI = Math::pi

The value of PI as a constant note that since it approximates cos(pi) may not equal 0.

*assert_true(math.cos(math.PI) == 1);
BittyBuzzMathFunctions::pow
void pow()
Calculates the base raised to the power of the exponent. Signature pow(base, exponent)
Definition: BittyBuzzMathFunctions.cpp:130