category-group: math
layer(s): 0, 1, 10

header file(s): z_mathsubs.h, z_hash.h, z_angle.h, z_rng.h, z_hash

synopsis.
The mathematics department of the Z Directory consists of a collection of classes for hashing, a few objects, and a set of subroutines for performing mathematical and statistical calculations, and some not-so-math operations such as getting the value of the desired column of a [base 10] number or getting the rightmost digit. The routines are fairly simple, common operations. However, the Z Directory does not provide a complete math package (there are many specialized mathematical packages out there).

The class objects include a random number generator (RNG), an "angle" object (computes angles; does radian - degree conversion); and hashing. Hashing in the Z Directory context includes CRC and crypto hashes such as MD5 or SHA-512. Currently the hashes include the following classes:

  hash_o .....: mother class - the ADT that provides the API
  murmerhash_o: by Austin Appleby (2008); 32-bit hash number
  CRC_o       : 2 implementations available, one is from UCB
  MD5hash_o   : MD5, algorithm: Ron Rivest; code: Colin Plumb
  SHA_o       : 3 SHA implementations/varieties: -256, -384, -512
Please refer to the "hash object" manual page for all hashes.

classes in this group: RNG_o, angle_o, hash_o

support/internal classes: tRNG_o

function groups: layer 00 functions group
                              layer 01 functions group

description.
here is a "short list" of most of the functions available:

z_lcd() ..............: compute Least Common Denominator
z_lcd_2vals() ........: compute the LCD of 2 numbers
z_factor() ...........: get the factors of a number
is_z_prime() .........: tell if a number is prime
is_z_prime() .........: tell if a number is prime
z_dmod() .............: '%' (modulus) operation, for real numbers
z_ilum() .............: Least Upper Multiple
z_lub() ..............: least upper bound
z_glb() ..............: greatest lower bound
z_lround() ...........: round a number up or down to closest integer
statistics:
z_is_divisible_by() ..: is the number evenly divisible by
z_cumulative_normal() : calculate cumulative normal distribution
z_cumulative_normal_v2(): cumulative normal; different algorithm
z_normal_distribution(): compute normal distribution (bell curve)
z_linear_regression() .: regression line slope & intercept
z_std_deviation() .....: compute standard deviation (array of numbers)
z_mean_avg() ..........: compute mean average of array of real numbers

algebra: z_power() ............: calculates the value a^b z_intpower() .........: x ^ p (raise integer to a power) z_sum_darray() .......: the sum of an array of values z_sum_sequence() .....: the sum of a range of integers is_z_within() ........: tells if two numbers are close to each other
z_max_random_number_value() ....: max value of a random number via RNG z_min_random_number_value() ....: returns 0 (smallest random number) z_big_random_number() ..........: generate random number [0..{big #}] z_random_number_viatime() ......: generate random #, using time z_init_random() ................: for initializing internal RNG other: z_str_to_int_wbase(): converts string to int type (w. base 2/8/10/16)

history.

        ??? 12/23/1988: z_lub(), z_glb() created
        ??? 02/05/1992: "interval_glb ()" deleted
        ??? 07/05/1996: did name changes, for standardization:
        Thu 07/11/1996: trying to get "RNG_o" working
        Mon 12/09/1996: z_lcd() made (while driving to Columbia, SC)
        Fri 04/25/1997: z_intpower() incorporated into z dir
        ??? 07/06/1996: "init_mathstuff()" made defunct
        Thu 05/30/2002: new #define naming conventions ("zos_", "zcc_")
        Tue 06/18/2002: bug fix, verification code (test driver)
        Sat 08/23/2003: hash: added explicit downcast, to silence gnu compiler
        Thu 04/23/2015: CRC function, z_str_to_int_wbase() moved, from strings
        Sat 04/25/2015: hash family of classes added
        Sun 04/26/2015: added MD5