<h1>Awk Part 11</h1>

<p>Gnu Awk Documentation: <a href="https://www.gnu.org/software/gawk/manual/gawk.html#String-Functions">https://www.gnu.org/software/gawk/manual/gawk.html#String-Functions</a></p>

<h2>Numerical functions</h2>

<ul>
<li>atan2: arctangent of y / x in randians</li>
<li>cos: cosine of x in radians</li>
<li>exp: e<sup>x</sup></li>
<li>int: floor float to int</li>
<li>log: natrual log</li>
<li>randn: (pseudo) random number between 0 and 1</li>
<li>sin: sine of x in radians</li>
<li>sqrt: square root</li>
<li>srand: (pseudo) random between 0 and 1, manually setting the seed</li>
</ul>


<h2>String functions</h2>

<ul>
<li>asort: array sort. Returns array with the values sorted</li>
<li>asori: array sort. Returns array with the keys (index) sorted</li>
<li>gensub: Search the target string target for matches of the regular expression regexp. Returns string with substituted text.</li>
<li>gsub: Search target for all of the longest, leftmost, nonoverlapping matching substrings it can find and replace them with replacement.   Returns string with substituted text.</li>
<li>sub: Search target, which is treated as a string, for the leftmost, longest substring matched by the regular expression regexp. Returns string with substituted text.</li>
<li>index: Search the string in for the first occurrence of the string find. Returns the position where that occurence begins</li>
<li>length: returns length of string</li>
<li>match: Search string for the longest, leftmost substring matched by the regular expression regexp and return the character position (index) at which that substring begins.</li>
<li>split: Divide string into pieces delimted by field separator. Returns an array of strings</li>
<li>sprintf: Allows you to store the a string in the that would have been the output of printf into a variable</li>
<li>strtonum: Turn octal representation to number</li>
<li>substr: Substring starting at position x for length of y. Returns string</li>
<li>tolower: Lower-case the string</li>
<li>toupper: Upper-case the string</li>
</ul>


<h2>References</h2>

<ul>
<li>Trigonometric functions: <a href="https://en.wikipedia.org/wiki/Trigonometric_functions">https://en.wikipedia.org/wiki/Trigonometric_functions</a></li>
<li>Psuedo random number seed: <a href="https://en.wikipedia.org/wiki/Random_seed">https://en.wikipedia.org/wiki/Random_seed</a></li>
<li>Natural log to log 10: <a href="https://math.stackexchange.com/questions/107574/from-natural-log-to-log-base-10#107576">https://math.stackexchange.com/questions/107574/from-natural-log-to-log-base-10#107576</a></li>
</ul>