/mathTools

A small utility for finding significant numbers from a set of numbers, as a learning experience.

Primary LanguageDMozilla Public License 2.0MPL-2.0

Math Utility

A small utility for finding significant numbers from a set of numbers, as a learning experience.

In-program Helpsheet

My program to find different significant values from a set of inputs. Input values via args and Files. Any arguments left after defined POSIX args are parsed are read into the input array.

Significant value outputs currently supported include:

Least Common Multiple

Greatest Common Factor

Largest Number

Smallest Number

Output Syntax:

Each output uses the output format [output string] = [output]. Each flag includes the output string in it's section.

Options:

--help, -h

Display this help and exits. Overrides all other arguments.

--file, -f

Reads input from a file specified as the next argument in the command. This must be a full file path!

--gcf

Prints the gcf of the input as part of the output. Uses 'GCF' as output string.

--lcm

Prints the lcm of the input as part of the output. Uses 'LCM' as output string.

--big

Prints the largest number from the input as part of the output. Uses 'Big' as output string.

--small

Prints the smallest number from the input as part of the output. Uses 'Small' as output string.

--sum

Prints the sum of all the inputs as part of the output. Uses 'Sum' as output string.

--product

Prints the product of all the inputs as a part of the output. Uses 'Product' as output string.

--sort

Sorts input using my implementation of the QuickSort algorithm. Uses "Sorted" as output string.

--average

Finds the average value of the input. Uses "Average" as output string.

--median

Finds the median value of the input. WARNING: This requires the sorting of the array. This will be done automatically. Uses "Median" as output string.

--mode

Finds the mode of the input. Uses "Mode" as output string.

Building

Building is fairly straightforward, as this is a dub project. Simply cd into the base repository directory and run dub build to build, or dub run to build and run. The executable will be located in the main directory, and will be ignored by this repository, as will any object code or other platform-specific stuff generated by dub. If you end up with generated content that should not be included in the repository, please add it to the gitignore.

Contributing

Fork this repo, clone it locally, and make changes! When you're ready, push your local changes to your fork, and then open a pull request!

See codemap.md for a mapping of all functions.

More functions are always wanted! If you want to write one, do so and open a pull request! If you don't know how to write one, let me know, and I'll add it!

To learn D, visit http://www.Dlang.org