<commit_before><!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>[name]</h1>

		<div class="desc">An object with several math utility functions.</div>

		<h2>Functions</h2>

		<h3>[method:Float clamp]( [page:Float value], [page:Float min], [page:Float max] )</h3>
		<div>
		[page:Float value] — Value to be clamped.<br />
		[page:Float min] — Minimum value.<br />
		[page:Float max] — Maximum value.<br /><br />

		Clamps the [page:Float value] to be between [page:Float min] and [page:Float max].
		</div>

		<h3>[method:Float degToRad]( [page:Float degrees] )</h3>
		<div>Converts degrees to radians.</div>

		<h3>[method:Integer euclideanModulo]( [page:Integer n], [page:Integer m] )</h3>
		<div>
		[page:Integer n], [page:Integer m] - Integers<br /><br />

		Compute the Euclidean modulo of m % [page:Integer n], that is:
		<code>( ( n % m ) + m ) % m</code>
		</div>

		<h3>[method:UUID generateUUID]( )</h3>
		<div>
		Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID]
		(universally unique identifier).
		</div>

		<h3>[method:Boolean isPowerOfTwo]( [page:Number n] )</h3>
		<div>Return *true* if [page:Number n] is a power of 2.</div>

		<h3>[method:Float lerp]( [page:Float x], [page:Float y], [page:Float t] )</h3>
		<div>
		[page:Float x] - Start point. <br />
		[page:Float y] - End point. <br />
		[page:Float t] - interpolation factor in the closed interval [0, 1].<br><br />

		Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated]
		from two known points based on the given interval - [page:Float t] = 0 will return [page:Float x]
		and [page:Float t] = 1 will return [page:Float y].
		</div>

		<h3>[method:Float mapLinear](
			[page:Float x],
			[page:Float a1],
			[page:Float a2],
			[page:Float b1],
			[page:Float b2] )</h3>
		<div>
		[page:Float x] — Value to be mapped.<br />
		[page:Float a1] — Minimum value for range A.<br />
		[page:Float a2] — Maximum value for range A.<br />
		[page:Float b1] — Minimum value for range B.<br />
		[page:Float b2] — Maximum value for range B.<br /><br />

		Linear mapping of [page:Float x] from range [[page:Float a1], [page:Float a2]] to range [[page:Float b1], [page:Float b2]].
		</div>

		<h3>[method:Integer nearestPowerOfTwo]( [page:Number n] )</h3>
		<div>	Return the nearest power of 2 to a given number [page:Number n].</div>

		<h3>[method:Integer nextPowerOfTwo]( [page:Number n] )</h3>
		<div>Return the nearest power of 2 that is bigger than [page:Number n].</div>

		<h3>[method:Float radToDeg]( [page:Float radians] )</h3>
		<div>Converts radians to degrees.</div>

		<h3>[method:Float randFloat]( [page:Float low], [page:Float high] )</h3>
		<div>Random float in the interval [page:Float low] to [page:Float high].</div>

		<h3>[method:Float randFloatSpread]( [page:Float range] )</h3>
		<div>Random float in the intercal *- [page:Float range] / 2* to *[page:Float range] / 2*.</div>

		<h3>[method:Integer randInt]( [page:Integer low], [page:Integer high] )</h3>
		<div>Random integer in the interval [page:Float low] to [page:Float high].</div>

		<h3>[method:Float smoothstep]( [page:Float x], [page:Float min], [page:Float max] )</h3>
		<div>
		[page:Float x] - The value to evaluate based on its position between min and max. <br />
		[page:Float min] - Any x value below min will be 0.<br />
		[page:Float max] - Any x value above max will be 1.<br /><br />

		Returns a value between 0-1 that represents the percentage that x has moved between min and max,
		but smoothed or slowed down the closer X is to the min and max.<br/><br/><commit_msg>Fixed minor errors<commit_after><!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>[name]</h1>

		<div class="desc">An object with several math utility functions.</div>

		<h2>Functions</h2>

		<h3>[method:Float clamp]( [page:Float value], [page:Float min], [page:Float max] )</h3>
		<div>
		[page:Float value] — Value to be clamped.<br />
		[page:Float min] — Minimum value.<br />
		[page:Float max] — Maximum value.<br /><br />

		Clamps the [page:Float value] to be between [page:Float min] and [page:Float max].
		</div>

		<h3>[method:Float degToRad]( [page:Float degrees] )</h3>
		<div>Converts degrees to radians.</div>

		<h3>[method:Integer euclideanModulo]( [page:Integer n], [page:Integer m] )</h3>
		<div>
		[page:Integer n], [page:Integer m] - Integers<br /><br />

		Computes the Euclidean modulo of [page:Integer m] % [page:Integer n], that is:
		<code>( ( n % m ) + m ) % m</code>
		</div>

		<h3>[method:UUID generateUUID]( )</h3>
		<div>
		Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID]
		(universally unique identifier).
		</div>

		<h3>[method:Boolean isPowerOfTwo]( [page:Number n] )</h3>
		<div>Return *true* if [page:Number n] is a power of 2.</div>

		<h3>[method:Float lerp]( [page:Float x], [page:Float y], [page:Float t] )</h3>
		<div>
		[page:Float x] - Start point. <br />
		[page:Float y] - End point. <br />
		[page:Float t] - interpolation factor in the closed interval [0, 1].<br><br />

		Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated]
		from two known points based on the given interval - [page:Float t] = 0 will return [page:Float x]
		and [page:Float t] = 1 will return [page:Float y].
		</div>

		<h3>[method:Float mapLinear](
			[page:Float x],
			[page:Float a1],
			[page:Float a2],
			[page:Float b1],
			[page:Float b2] )</h3>
		<div>
		[page:Float x] — Value to be mapped.<br />
		[page:Float a1] — Minimum value for range A.<br />
		[page:Float a2] — Maximum value for range A.<br />
		[page:Float b1] — Minimum value for range B.<br />
		[page:Float b2] — Maximum value for range B.<br /><br />

		Linear mapping of [page:Float x] from range [[page:Float a1], [page:Float a2]] to range [[page:Float b1], [page:Float b2]].
		</div>

		<h3>[method:Integer nearestPowerOfTwo]( [page:Number n] )</h3>
		<div>	Returns the nearest power of 2 to a given number [page:Number n].</div>

		<h3>[method:Integer nextPowerOfTwo]( [page:Number n] )</h3>
		<div>Returns the nearest power of 2 that is bigger than [page:Number n].</div>

		<h3>[method:Float radToDeg]( [page:Float radians] )</h3>
		<div>Converts radians to degrees.</div>

		<h3>[method:Float randFloat]( [page:Float low], [page:Float high] )</h3>
		<div>Random float in the interval [page:Float low] to [page:Float high].</div>

		<h3>[method:Float randFloatSpread]( [page:Float range] )</h3>
		<div>Random float in the interval *- [page:Float range] / 2* to *[page:Float range] / 2*.</div>

		<h3>[method:Integer randInt]( [page:Integer low], [page:Integer high] )</h3>
		<div>Random integer in the interval [page:Float low] to [page:Float high].</div>

		<h3>[method:Float smoothstep]( [page:Float x], [page:Float min], [page:Float max] )</h3>
		<div>
		[page:Float x] - The value to evaluate based on its position between min and max. <br />
		[page:Float min] - Any x value below min will be 0.<br />
		[page:Float max] - Any x value above max will be 1.<br /><br />

		Returns a value between 0-1 that represents the percentage that x has moved between min and max,
		but smoothed or slowed down the closer X is to the min and max.<br/><br/>
{'fraction_non_alphanumeric': 0.1762235927043695, 'fraction_numerical': 0.015221099593229235, 'mean_word_length': 3.9237726098191215, 'pattern_counts': {'":': 0, '<': 197, '<?xml version=': 0, '>': 197, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5594616', 'n_tokens_mistral': 2996, 'n_tokens_neox': 2698, 'n_words': 884}