aboutsummaryrefslogtreecommitdiff
path: root/docs/nums.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-05 00:40:00 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-03-05 00:40:00 -0500
commit9a3162633d358c9dc698b2733027981203514dc9 (patch)
tree38f6ebd8121f5dab2f04173dda8b9cefd2de1fdf /docs/nums.md
parentdba2d62d15d8233c189a109f97d7cda70fa7f6b7 (diff)
Shorten API docs
Diffstat (limited to 'docs/nums.md')
-rw-r--r--docs/nums.md196
1 files changed, 0 insertions, 196 deletions
diff --git a/docs/nums.md b/docs/nums.md
index f66314d3..4bfe1fec 100644
--- a/docs/nums.md
+++ b/docs/nums.md
@@ -170,8 +170,6 @@ called either on the type itself: `Num.sqrt(x)` or as a method call:
- [`func y1(x: Num -> Num)`](#y1)
### `abs`
-
-**Description:**
Calculates the absolute value of a number.
**Signature:**
@@ -179,8 +177,6 @@ Calculates the absolute value of a number.
func abs(n: Num -> Num)
```
-**Parameters:**
-
- `n`: The number whose absolute value is to be computed.
**Returns:**
@@ -195,8 +191,6 @@ The absolute value of `n`.
---
### `acos`
-
-**Description:**
Computes the arc cosine of a number.
**Signature:**
@@ -204,8 +198,6 @@ Computes the arc cosine of a number.
func acos(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the arc cosine is to be calculated.
**Returns:**
@@ -220,8 +212,6 @@ The arc cosine of `x` in radians.
---
### `acosh`
-
-**Description:**
Computes the inverse hyperbolic cosine of a number.
**Signature:**
@@ -229,8 +219,6 @@ Computes the inverse hyperbolic cosine of a number.
func acosh(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the inverse hyperbolic cosine is to be calculated.
**Returns:**
@@ -245,8 +233,6 @@ The inverse hyperbolic cosine of `x`.
---
### `asin`
-
-**Description:**
Computes the arc sine of a number.
**Signature:**
@@ -254,8 +240,6 @@ Computes the arc sine of a number.
func asin(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the arc sine is to be calculated.
**Returns:**
@@ -270,8 +254,6 @@ The arc sine of `x` in radians.
---
### `asinh`
-
-**Description:**
Computes the inverse hyperbolic sine of a number.
**Signature:**
@@ -279,8 +261,6 @@ Computes the inverse hyperbolic sine of a number.
func asinh(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the inverse hyperbolic sine is to be calculated.
**Returns:**
@@ -295,8 +275,6 @@ The inverse hyperbolic sine of `x`.
---
### `atan`
-
-**Description:**
Computes the arc tangent of a number.
**Signature:**
@@ -304,8 +282,6 @@ Computes the arc tangent of a number.
func atan(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the arc tangent is to be calculated.
**Returns:**
@@ -320,8 +296,6 @@ The arc tangent of `x` in radians.
---
### `atan2`
-
-**Description:**
Computes the arc tangent of the quotient of two numbers.
**Signature:**
@@ -329,8 +303,6 @@ Computes the arc tangent of the quotient of two numbers.
func atan2(x: Num, y: Num -> Num)
```
-**Parameters:**
-
- `x`: The numerator.
- `y`: The denominator.
@@ -346,8 +318,6 @@ The arc tangent of `x/y` in radians.
---
### `atanh`
-
-**Description:**
Computes the inverse hyperbolic tangent of a number.
**Signature:**
@@ -355,8 +325,6 @@ Computes the inverse hyperbolic tangent of a number.
func atanh(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the inverse hyperbolic tangent is to be calculated.
**Returns:**
@@ -371,8 +339,6 @@ The inverse hyperbolic tangent of `x`.
---
### `cbrt`
-
-**Description:**
Computes the cube root of a number.
**Signature:**
@@ -380,8 +346,6 @@ Computes the cube root of a number.
func cbrt(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the cube root is to be calculated.
**Returns:**
@@ -396,8 +360,6 @@ The cube root of `x`.
---
### `ceil`
-
-**Description:**
Rounds a number up to the nearest integer.
**Signature:**
@@ -405,8 +367,6 @@ Rounds a number up to the nearest integer.
func ceil(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number to be rounded up.
**Returns:**
@@ -421,8 +381,6 @@ The smallest integer greater than or equal to `x`.
---
### `clamped`
-
-**Description:**
Returns the given number clamped between two values so that it is within
that range.
@@ -431,8 +389,6 @@ that range.
clamped(x, low, high: Num -> Num)
```
-**Parameters:**
-
- `x`: The number to clamp.
- `low`: The lowest value the result can take.
- `high`: The highest value the result can take.
@@ -449,8 +405,6 @@ The first argument clamped between the other two arguments.
---
### `copysign`
-
-**Description:**
Copies the sign of one number to another.
**Signature:**
@@ -458,8 +412,6 @@ Copies the sign of one number to another.
func copysign(x: Num, y: Num -> Num)
```
-**Parameters:**
-
- `x`: The number whose magnitude will be copied.
- `y`: The number whose sign will be copied.
@@ -475,8 +427,6 @@ A number with the magnitude of `x` and the sign of `y`.
---
### `cos`
-
-**Description:**
Computes the cosine of a number (angle in radians).
**Signature:**
@@ -484,8 +434,6 @@ Computes the cosine of a number (angle in radians).
func cos(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The angle in radians.
**Returns:**
@@ -500,8 +448,6 @@ The cosine of `x`.
---
### `cosh`
-
-**Description:**
Computes the hyperbolic cosine of a number.
**Signature:**
@@ -509,8 +455,6 @@ Computes the hyperbolic cosine of a number.
func cosh(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the hyperbolic cosine is to be calculated.
**Returns:**
@@ -525,8 +469,6 @@ The hyperbolic cosine of `x`.
---
### `erf`
-
-**Description:**
Computes the error function of a number.
**Signature:**
@@ -534,8 +476,6 @@ Computes the error function of a number.
func erf(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the error function is to be calculated.
**Returns:**
@@ -550,8 +490,6 @@ The error function of `x`.
---
### `erfc`
-
-**Description:**
Computes the complementary error function of a number.
**Signature:**
@@ -559,8 +497,6 @@ Computes the complementary error function of a number.
func erfc(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the complementary error function is to be calculated.
**Returns:**
@@ -575,8 +511,6 @@ The complementary error function of `x`.
---
### `exp`
-
-**Description:**
Computes the exponential function \( e^x \) for a number.
**Signature:**
@@ -584,8 +518,6 @@ Computes the exponential function \( e^x \) for a number.
func exp(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The exponent.
**Returns:**
@@ -600,8 +532,6 @@ The value of \( e^x \).
---
### `exp2`
-
-**Description:**
Computes \( 2^x \) for a number.
**Signature:**
@@ -609,8 +539,6 @@ Computes \( 2^x \) for a number.
func exp2(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The exponent.
**Returns:**
@@ -625,8 +553,6 @@ The value of \( 2^x \).
---
### `expm1`
-
-**Description:**
Computes \( e^x - 1 \) for a number.
**Signature:**
@@ -634,8 +560,6 @@ Computes \( e^x - 1 \) for a number.
func expm1(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The exponent.
**Returns:**
@@ -650,8 +574,6 @@ The value of \( e^x - 1 \).
---
### `fdim`
-
-**Description:**
Computes the positive difference between two numbers.
**Signature:**
@@ -659,8 +581,6 @@ Computes the positive difference between two numbers.
func fdim(x: Num, y: Num -> Num)
```
-**Parameters:**
-
- `x`: The first number.
- `y`: The second number.
@@ -678,8 +598,6 @@ fd
---
### `floor`
-
-**Description:**
Rounds a number down to the nearest integer.
**Signature:**
@@ -687,8 +605,6 @@ Rounds a number down to the nearest integer.
func floor(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number to be rounded down.
**Returns:**
@@ -703,8 +619,6 @@ The largest integer less than or equal to `x`.
---
### `format`
-
-**Description:**
Formats a number as a text with a specified precision.
**Signature:**
@@ -712,8 +626,6 @@ Formats a number as a text with a specified precision.
func format(n: Num, precision: Int = 0 -> Text)
```
-**Parameters:**
-
- `n`: The number to be formatted.
- `precision`: The number of decimal places. Default is `0`.
@@ -729,8 +641,6 @@ A text representation of the number with the specified precision.
---
### `hypot`
-
-**Description:**
Computes the Euclidean norm, \( \sqrt{x^2 + y^2} \), of two numbers.
**Signature:**
@@ -738,8 +648,6 @@ Computes the Euclidean norm, \( \sqrt{x^2 + y^2} \), of two numbers.
func hypot(x: Num, y: Num -> Num)
```
-**Parameters:**
-
- `x`: The first number.
- `y`: The second number.
@@ -755,8 +663,6 @@ The Euclidean norm of `x` and `y`.
---
### `isfinite`
-
-**Description:**
Checks if a number is finite.
**Signature:**
@@ -764,8 +670,6 @@ Checks if a number is finite.
func isfinite(n: Num -> Bool)
```
-**Parameters:**
-
- `n`: The number to be checked.
**Returns:**
@@ -782,8 +686,6 @@ func isfinite(n: Num -> Bool)
---
### `isinf`
-
-**Description:**
Checks if a number is infinite.
**Signature:**
@@ -791,8 +693,6 @@ Checks if a number is infinite.
func isinf(n: Num -> Bool)
```
-**Parameters:**
-
- `n`: The number to be checked.
**Returns:**
@@ -809,8 +709,6 @@ func isinf(n: Num -> Bool)
---
### `j0`
-
-**Description:**
Computes the Bessel function of the first kind of order 0.
**Signature:**
@@ -818,8 +716,6 @@ Computes the Bessel function of the first kind of order 0.
func j0(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the Bessel function is to be calculated.
**Returns:**
@@ -834,8 +730,6 @@ The Bessel function of the first kind of order 0 of `x`.
---
### `j1`
-
-**Description:**
Computes the Bessel function of the first kind of order 1.
**Signature:**
@@ -843,8 +737,6 @@ Computes the Bessel function of the first kind of order 1.
func j1(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the Bessel function is to be calculated.
**Returns:**
@@ -859,8 +751,6 @@ The Bessel function of the first kind of order 1 of `x`.
---
### `log`
-
-**Description:**
Computes the natural logarithm (base \( e \)) of a number.
**Signature:**
@@ -868,8 +758,6 @@ Computes the natural logarithm (base \( e \)) of a number.
func log(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the natural logarithm is to be calculated.
**Returns:**
@@ -884,8 +772,6 @@ The natural logarithm of `x`.
---
### `log10`
-
-**Description:**
Computes the base-10 logarithm of a number.
**Signature:**
@@ -893,8 +779,6 @@ Computes the base-10 logarithm of a number.
func log10(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the base-10 logarithm is to be calculated.
**Returns:**
@@ -909,8 +793,6 @@ The base-10 logarithm of `x`.
---
### `log1p`
-
-**Description:**
Computes \( \log(1 + x) \) for a number.
**Signature:**
@@ -918,8 +800,6 @@ Computes \( \log(1 + x) \) for a number.
func log1p(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which \( \log(1 + x) \) is to be calculated.
**Returns:**
@@ -934,8 +814,6 @@ The value of \( \log(1 + x) \).
---
### `log2`
-
-**Description:**
Computes the base-2 logarithm of a number.
**Signature:**
@@ -943,8 +821,6 @@ Computes the base-2 logarithm of a number.
func log2(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the base-2 logarithm is to be calculated.
**Returns:**
@@ -959,8 +835,6 @@ The base-2 logarithm of `x`.
---
### `logb`
-
-**Description:**
Computes the binary exponent (base-2 logarithm) of a number.
**Signature:**
@@ -968,8 +842,6 @@ Computes the binary exponent (base-2 logarithm) of a number.
func logb(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the binary exponent is to be calculated.
**Returns:**
@@ -984,8 +856,6 @@ The binary exponent of `x`.
---
### `mix`
-
-**Description:**
Interpolates between two numbers based on a given amount.
**Signature:**
@@ -993,8 +863,6 @@ Interpolates between two numbers based on a given amount.
func mix(amount: Num, x: Num, y: Num -> Num)
```
-**Parameters:**
-
- `amount`: The interpolation factor (between `0` and `1`).
- `x`: The starting number.
- `y`: The ending number.
@@ -1013,8 +881,6 @@ The interpolated number between `x` and `y` based on `amount`.
---
### `near`
-
-**Description:**
Checks if two numbers are approximately equal within specified tolerances. If
two numbers are within an absolute difference or the ratio between the two is
small enough, they are considered near each other.
@@ -1024,8 +890,6 @@ small enough, they are considered near each other.
func near(x: Num, y: Num, ratio: Num = 1e-9, min_epsilon: Num = 1e-9 -> Bool)
```
-**Parameters:**
-
- `x`: The first number.
- `y`: The second number.
- `ratio`: The relative tolerance. Default is `1e-9`.
@@ -1049,8 +913,6 @@ func near(x: Num, y: Num, ratio: Num = 1e-9, min_epsilon: Num = 1e-9 -> Bool)
---
### `nextafter`
-
-**Description:**
Computes the next representable value after a given number towards a specified direction.
**Signature:**
@@ -1058,8 +920,6 @@ Computes the next representable value after a given number towards a specified d
func nextafter(x: Num, y: Num -> Num)
```
-**Parameters:**
-
- `x`: The starting number.
- `y`: The direction towards which to find the next representable value.
@@ -1075,8 +935,6 @@ The next representable value after `x` in the direction of `y`.
---
### `parse`
-
-**Description:**
Converts a text representation of a number into a floating-point number.
**Signature:**
@@ -1084,8 +942,6 @@ Converts a text representation of a number into a floating-point number.
func parse(text: Text -> Num?)
```
-**Parameters:**
-
- `text`: The text containing the number.
**Returns:**
@@ -1103,8 +959,6 @@ as a number.
---
### `rint`
-
-**Description:**
Rounds a number to the nearest integer, with ties rounded to the nearest even integer.
**Signature:**
@@ -1112,8 +966,6 @@ Rounds a number to the nearest integer, with ties rounded to the nearest even in
func rint(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number to be rounded.
**Returns:**
@@ -1130,8 +982,6 @@ The nearest integer value of `x`.
---
### `round`
-
-**Description:**
Rounds a number to the nearest whole number integer.
**Signature:**
@@ -1139,8 +989,6 @@ Rounds a number to the nearest whole number integer.
func round(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number to be rounded.
**Returns:**
@@ -1157,8 +1005,6 @@ The nearest integer value of `x`.
---
### `scientific`
-
-**Description:**
Formats a number in scientific notation with a specified precision.
**Signature:**
@@ -1166,8 +1012,6 @@ Formats a number in scientific notation with a specified precision.
func scientific(n: Num, precision: Int = 0 -> Text)
```
-**Parameters:**
-
- `n`: The number to be formatted.
- `precision`: The number of decimal places. Default is `0`.
@@ -1183,8 +1027,6 @@ A text representation of the number in scientific notation with the specified pr
---
### `significand`
-
-**Description:**
Extracts the significand (or mantissa) of a number.
**Signature:**
@@ -1192,8 +1034,6 @@ Extracts the significand (or mantissa) of a number.
func significand(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number from which to extract the significand.
**Returns:**
@@ -1208,8 +1048,6 @@ The significand of `x`.
---
### `sin`
-
-**Description:**
Computes the sine of a number (angle in radians).
**Signature:**
@@ -1217,8 +1055,6 @@ Computes the sine of a number (angle in radians).
func sin(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The angle in radians.
**Returns:**
@@ -1233,8 +1069,6 @@ The sine of `x`.
---
### `sinh`
-
-**Description:**
Computes the hyperbolic sine of a number.
**Signature:**
@@ -1242,8 +1076,6 @@ Computes the hyperbolic sine of a number.
func sinh(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the hyperbolic sine is to be calculated.
**Returns:**
@@ -1258,8 +1090,6 @@ The hyperbolic sine of `x`.
---
### `sqrt`
-
-**Description:**
Computes the square root of a number.
**Signature:**
@@ -1267,8 +1097,6 @@ Computes the square root of a number.
func sqrt(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the square root is to be calculated.
**Returns:**
@@ -1283,8 +1111,6 @@ The square root of `x`.
---
### `tan`
-
-**Description:**
Computes the tangent of a number (angle in radians).
**Signature:**
@@ -1292,8 +1118,6 @@ Computes the tangent of a number (angle in radians).
func tan(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The angle in radians.
**Returns:**
@@ -1308,8 +1132,6 @@ The tangent of `x`.
---
### `tanh`
-
-**Description:**
Computes the hyperbolic tangent of a number.
**Signature:**
@@ -1317,8 +1139,6 @@ Computes the hyperbolic tangent of a number.
func tanh(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the hyperbolic tangent is to be calculated.
**Returns:**
@@ -1333,8 +1153,6 @@ The hyperbolic tangent of `x`.
---
### `tgamma`
-
-**Description:**
Computes the gamma function of a number.
**Signature:**
@@ -1342,8 +1160,6 @@ Computes the gamma function of a number.
func tgamma(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the gamma function is to be calculated.
**Returns:**
@@ -1358,8 +1174,6 @@ The gamma function of `x`.
---
### `trunc`
-
-**Description:**
Truncates a number to the nearest integer towards zero.
**Signature:**
@@ -1367,8 +1181,6 @@ Truncates a number to the nearest integer towards zero.
func trunc(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number to be truncated.
**Returns:**
@@ -1385,8 +1197,6 @@ The integer part of `x` towards zero.
---
### `y0`
-
-**Description:**
Computes the Bessel function of the second kind of order 0.
**Signature:**
@@ -1394,8 +1204,6 @@ Computes the Bessel function of the second kind of order 0.
func y0(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the Bessel function is to be calculated.
**Returns:**
@@ -1410,8 +1218,6 @@ The Bessel function of the second kind of order 0 of `x`.
---
### `y1`
-
-**Description:**
Computes the Bessel function of the second kind of order 1.
**Signature:**
@@ -1419,8 +1225,6 @@ Computes the Bessel function of the second kind of order 1.
func y1(x: Num -> Num)
```
-**Parameters:**
-
- `x`: The number for which the Bessel function is to be calculated.
**Returns:**