From 4614be0edcf234278ee5aedd6479b52f739d73ad Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 11 Dec 2025 13:55:51 -0500 Subject: Rename Float64 -> Float in docs --- api/api.md | 406 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 203 insertions(+), 203 deletions(-) (limited to 'api/api.md') diff --git a/api/api.md b/api/api.md index 61ef9424..e5b45f5d 100644 --- a/api/api.md +++ b/api/api.md @@ -409,130 +409,130 @@ assert CString(",").join([CString("a"), CString("b")]) == CString("a,b") ``` -# Float64 -## Float64.1_PI +# Float +## Float.1_PI ```tomo -Float64.1_PI : Float64 +Float.1_PI : Float ``` The constant $\frac{1}{\pi}$. -## Float64.2_PI +## Float.2_PI ```tomo -Float64.2_PI : Float64 +Float.2_PI : Float ``` The constant $2 \times \pi$. -## Float64.2_SQRTPI +## Float.2_SQRTPI ```tomo -Float64.2_SQRTPI : Float64 +Float.2_SQRTPI : Float ``` The constant $2 \times \sqrt{\pi}$. -## Float64.E +## Float.E ```tomo -Float64.E : Float64 +Float.E : Float ``` The base of the natural logarithm ($e$). -## Float64.INF +## Float.INF ```tomo -Float64.INF : Float64 +Float.INF : Float ``` Positive infinity. -## Float64.LN10 +## Float.LN10 ```tomo -Float64.LN10 : Float64 +Float.LN10 : Float ``` The natural logarithm of 10. -## Float64.LN2 +## Float.LN2 ```tomo -Float64.LN2 : Float64 +Float.LN2 : Float ``` The natural logarithm of 2. -## Float64.LOG2E +## Float.LOG2E ```tomo -Float64.LOG2E : Float64 +Float.LOG2E : Float ``` The base 2 logarithm of $e$ -## Float64.PI +## Float.PI ```tomo -Float64.PI : Float64 +Float.PI : Float ``` Pi ($\pi$). -## Float64.PI_2 +## Float.PI_2 ```tomo -Float64.PI_2 : Float64 +Float.PI_2 : Float ``` $\frac{\pi}{2}$ -## Float64.PI_4 +## Float.PI_4 ```tomo -Float64.PI_4 : Float64 +Float.PI_4 : Float ``` $\frac{\pi}{4}$ -## Float64.SQRT1_2 +## Float.SQRT1_2 ```tomo -Float64.SQRT1_2 : Float64 +Float.SQRT1_2 : Float ``` $\sqrt{\frac{1}{2}}$ -## Float64.SQRT2 +## Float.SQRT2 ```tomo -Float64.SQRT2 : Float64 +Float.SQRT2 : Float ``` $\sqrt{2}$ -## Float64.TAU +## Float.TAU ```tomo -Float64.TAU : Float64 +Float.TAU : Float ``` Tau ($2 \times \pi$) -## Float64.abs +## Float.abs ```tomo -Float64.abs : func(n: Float64 -> Float64) +Float.abs : func(n: Float -> Float) ``` Calculates the absolute value of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -n | `Float64` | The number whose absolute value is to be computed. | - +n | `Float` | The number whose absolute value is to be computed. | - **Return:** The absolute value of `n`. @@ -542,17 +542,17 @@ n | `Float64` | The number whose absolute value is to be computed. | - assert (-3.5).abs() == 3.5 ``` -## Float64.acos +## Float.acos ```tomo -Float64.acos : func(x: Float64 -> Float64) +Float.acos : func(x: Float -> Float) ``` Computes the arc cosine of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the arc cosine is to be calculated. | - +x | `Float` | The number for which the arc cosine is to be calculated. | - **Return:** The arc cosine of `x` in radians. @@ -562,17 +562,17 @@ x | `Float64` | The number for which the arc cosine is to be calculated. | - assert (0.0).acos() == 1.5708 ``` -## Float64.acosh +## Float.acosh ```tomo -Float64.acosh : func(x: Float64 -> Float64) +Float.acosh : func(x: Float -> Float) ``` Computes the inverse hyperbolic cosine of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the inverse hyperbolic cosine is to be calculated. | - +x | `Float` | The number for which the inverse hyperbolic cosine is to be calculated. | - **Return:** The inverse hyperbolic cosine of `x`. @@ -582,17 +582,17 @@ x | `Float64` | The number for which the inverse hyperbolic cosine is to be calc assert (1.0).acosh() == 0 ``` -## Float64.asin +## Float.asin ```tomo -Float64.asin : func(x: Float64 -> Float64) +Float.asin : func(x: Float -> Float) ``` Computes the arc sine of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the arc sine is to be calculated. | - +x | `Float` | The number for which the arc sine is to be calculated. | - **Return:** The arc sine of `x` in radians. @@ -602,17 +602,17 @@ x | `Float64` | The number for which the arc sine is to be calculated. | - assert (0.5).asin() == 0.5236 ``` -## Float64.asinh +## Float.asinh ```tomo -Float64.asinh : func(x: Float64 -> Float64) +Float.asinh : func(x: Float -> Float) ``` Computes the inverse hyperbolic sine of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the inverse hyperbolic sine is to be calculated. | - +x | `Float` | The number for which the inverse hyperbolic sine is to be calculated. | - **Return:** The inverse hyperbolic sine of `x`. @@ -622,17 +622,17 @@ x | `Float64` | The number for which the inverse hyperbolic sine is to be calcul assert (0.0).asinh() == 0 ``` -## Float64.atan +## Float.atan ```tomo -Float64.atan : func(x: Float64 -> Float64) +Float.atan : func(x: Float -> Float) ``` Computes the arc tangent of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the arc tangent is to be calculated. | - +x | `Float` | The number for which the arc tangent is to be calculated. | - **Return:** The arc tangent of `x` in radians. @@ -642,38 +642,38 @@ x | `Float64` | The number for which the arc tangent is to be calculated. | - assert (1.0).atan() == 0.7854 ``` -## Float64.atan2 +## Float.atan2 ```tomo -Float64.atan2 : func(x: Float64, y: Float64 -> Float64) +Float.atan2 : func(x: Float, y: Float -> Float) ``` Computes the arc tangent of the quotient of two numbers. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The numerator. | - -y | `Float64` | The denominator. | - +x | `Float` | The numerator. | - +y | `Float` | The denominator. | - **Return:** The arc tangent of `x/y` in radians. **Example:** ```tomo -assert Float64.atan2(1, 1) == 0.7854 +assert Float.atan2(1, 1) == 0.7854 ``` -## Float64.atanh +## Float.atanh ```tomo -Float64.atanh : func(x: Float64 -> Float64) +Float.atanh : func(x: Float -> Float) ``` Computes the inverse hyperbolic tangent of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the inverse hyperbolic tangent is to be calculated. | - +x | `Float` | The number for which the inverse hyperbolic tangent is to be calculated. | - **Return:** The inverse hyperbolic tangent of `x`. @@ -683,17 +683,17 @@ x | `Float64` | The number for which the inverse hyperbolic tangent is to be cal assert (0.5).atanh() == 0.5493 ``` -## Float64.cbrt +## Float.cbrt ```tomo -Float64.cbrt : func(x: Float64 -> Float64) +Float.cbrt : func(x: Float -> Float) ``` Computes the cube root of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the cube root is to be calculated. | - +x | `Float` | The number for which the cube root is to be calculated. | - **Return:** The cube root of `x`. @@ -703,17 +703,17 @@ x | `Float64` | The number for which the cube root is to be calculated. | - assert (27.0).cbrt() == 3 ``` -## Float64.ceil +## Float.ceil ```tomo -Float64.ceil : func(x: Float64 -> Float64) +Float.ceil : func(x: Float -> Float) ``` Rounds a number up to the nearest integer. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number to be rounded up. | - +x | `Float` | The number to be rounded up. | - **Return:** The smallest integer greater than or equal to `x`. @@ -723,19 +723,19 @@ x | `Float64` | The number to be rounded up. | - assert (3.2).ceil() == 4 ``` -## Float64.clamped +## Float.clamped ```tomo -Float64.clamped : func(x: Float64, low: Float64, high: Float64 -> Float64) +Float.clamped : func(x: Float, low: Float, high: Float -> Float) ``` Returns the given number clamped between two values so that it is within that range. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number to clamp. | - -low | `Float64` | The lowest value the result can take. | - -high | `Float64` | The highest value the result can take. | - +x | `Float` | The number to clamp. | - +low | `Float` | The lowest value the result can take. | - +high | `Float` | The highest value the result can take. | - **Return:** The first argument clamped between the other two arguments. @@ -745,18 +745,18 @@ high | `Float64` | The highest value the result can take. | - assert (2.5).clamped(5.5, 10.5) == 5.5 ``` -## Float64.copysign +## Float.copysign ```tomo -Float64.copysign : func(x: Float64, y: Float64 -> Float64) +Float.copysign : func(x: Float, y: Float -> Float) ``` Copies the sign of one number to another. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number whose magnitude will be copied. | - -y | `Float64` | The number whose sign will be copied. | - +x | `Float` | The number whose magnitude will be copied. | - +y | `Float` | The number whose sign will be copied. | - **Return:** A number with the magnitude of `x` and the sign of `y`. @@ -766,17 +766,17 @@ y | `Float64` | The number whose sign will be copied. | - assert (3.0).copysign(-1) == -3 ``` -## Float64.cos +## Float.cos ```tomo -Float64.cos : func(x: Float64 -> Float64) +Float.cos : func(x: Float -> Float) ``` Computes the cosine of a number (angle in radians). Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The angle in radians. | - +x | `Float` | The angle in radians. | - **Return:** The cosine of `x`. @@ -786,17 +786,17 @@ x | `Float64` | The angle in radians. | - assert (0.0).cos() == 1 ``` -## Float64.cosh +## Float.cosh ```tomo -Float64.cosh : func(x: Float64 -> Float64) +Float.cosh : func(x: Float -> Float) ``` Computes the hyperbolic cosine of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the hyperbolic cosine is to be calculated. | - +x | `Float` | The number for which the hyperbolic cosine is to be calculated. | - **Return:** The hyperbolic cosine of `x`. @@ -806,17 +806,17 @@ x | `Float64` | The number for which the hyperbolic cosine is to be calculated. assert (0.0).cosh() == 1 ``` -## Float64.erf +## Float.erf ```tomo -Float64.erf : func(x: Float64 -> Float64) +Float.erf : func(x: Float -> Float) ``` Computes the error function of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the error function is to be calculated. | - +x | `Float` | The number for which the error function is to be calculated. | - **Return:** The error function of `x`. @@ -826,17 +826,17 @@ x | `Float64` | The number for which the error function is to be calculated. | assert (0.0).erf() == 0 ``` -## Float64.erfc +## Float.erfc ```tomo -Float64.erfc : func(x: Float64 -> Float64) +Float.erfc : func(x: Float -> Float) ``` Computes the complementary error function of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the complementary error function is to be calculated. | - +x | `Float` | The number for which the complementary error function is to be calculated. | - **Return:** The complementary error function of `x`. @@ -846,17 +846,17 @@ x | `Float64` | The number for which the complementary error function is to be c assert (0.0).erfc() == 1 ``` -## Float64.exp +## Float.exp ```tomo -Float64.exp : func(x: Float64 -> Float64) +Float.exp : func(x: Float -> Float) ``` Computes the exponential function $e^x$ for a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The exponent. | - +x | `Float` | The exponent. | - **Return:** The value of $e^x$. @@ -866,17 +866,17 @@ x | `Float64` | The exponent. | - assert (1.0).exp() == 2.7183 ``` -## Float64.exp2 +## Float.exp2 ```tomo -Float64.exp2 : func(x: Float64 -> Float64) +Float.exp2 : func(x: Float -> Float) ``` Computes $2^x$ for a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The exponent. | - +x | `Float` | The exponent. | - **Return:** The value of $2^x$. @@ -886,17 +886,17 @@ x | `Float64` | The exponent. | - assert (3.0).exp2() == 8 ``` -## Float64.expm1 +## Float.expm1 ```tomo -Float64.expm1 : func(x: Float64 -> Float64) +Float.expm1 : func(x: Float -> Float) ``` Computes $e^x - 1$ for a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The exponent. | - +x | `Float` | The exponent. | - **Return:** The value of $e^x - 1$. @@ -906,18 +906,18 @@ x | `Float64` | The exponent. | - assert (1.0).expm1() == 1.7183 ``` -## Float64.fdim +## Float.fdim ```tomo -Float64.fdim : func(x: Float64, y: Float64 -> Float64) +Float.fdim : func(x: Float, y: Float -> Float) ``` Computes the positive difference between two numbers. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The first number. | - -y | `Float64` | The second number. | - +x | `Float` | The first number. | - +y | `Float` | The second number. | - **Return:** The positive difference $\max(0, x - y)$. @@ -929,17 +929,17 @@ fd assert (5.0).fdim(3) == 2 ``` -## Float64.floor +## Float.floor ```tomo -Float64.floor : func(x: Float64 -> Float64) +Float.floor : func(x: Float -> Float) ``` Rounds a number down to the nearest integer. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number to be rounded down. | - +x | `Float` | The number to be rounded down. | - **Return:** The largest integer less than or equal to `x`. @@ -949,40 +949,40 @@ x | `Float64` | The number to be rounded down. | - assert (3.7).floor() == 3 ``` -## Float64.hypot +## Float.hypot ```tomo -Float64.hypot : func(x: Float64, y: Float64 -> Float64) +Float.hypot : func(x: Float, y: Float -> Float) ``` Computes the Euclidean norm, $\sqrt{x^2 + y^2}$, of two numbers. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The first number. | - -y | `Float64` | The second number. | - +x | `Float` | The first number. | - +y | `Float` | The second number. | - **Return:** The Euclidean norm of `x` and `y`. **Example:** ```tomo -assert Float64.hypot(3, 4) == 5 +assert Float.hypot(3, 4) == 5 ``` -## Float64.is_between +## Float.is_between ```tomo -Float64.is_between : func(x: Float64, low: Float64, high: Float64 -> Bool) +Float.is_between : func(x: Float, low: Float, high: Float -> Bool) ``` Determines if a number is between two numbers (inclusive). Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The integer to be checked. | - -low | `Float64` | The lower bound to check (inclusive). | - -high | `Float64` | The upper bound to check (inclusive). | - +x | `Float` | The integer to be checked. | - +low | `Float` | The lower bound to check (inclusive). | - +high | `Float` | The upper bound to check (inclusive). | - **Return:** `yes` if `low <= x and x <= high`, otherwise `no` @@ -994,17 +994,17 @@ assert (7.5).is_between(100, 200) == no assert (7.5).is_between(1, 7.5) == yes ``` -## Float64.isfinite +## Float.isfinite ```tomo -Float64.isfinite : func(n: Float64 -> Bool) +Float.isfinite : func(n: Float -> Bool) ``` Checks if a number is finite. Argument | Type | Description | Default ---------|------|-------------|--------- -n | `Float64` | The number to be checked. | - +n | `Float` | The number to be checked. | - **Return:** `yes` if `n` is finite, `no` otherwise. @@ -1012,41 +1012,41 @@ n | `Float64` | The number to be checked. | - **Example:** ```tomo assert (1.0).isfinite() == yes -assert Float64.INF.isfinite() == no +assert Float.INF.isfinite() == no ``` -## Float64.isinf +## Float.isinf ```tomo -Float64.isinf : func(n: Float64 -> Bool) +Float.isinf : func(n: Float -> Bool) ``` Checks if a number is infinite. Argument | Type | Description | Default ---------|------|-------------|--------- -n | `Float64` | The number to be checked. | - +n | `Float` | The number to be checked. | - **Return:** `yes` if `n` is infinite, `no` otherwise. **Example:** ```tomo -assert Float64.INF.isinf() == yes +assert Float.INF.isinf() == yes assert (1.0).isinf() == no ``` -## Float64.j0 +## Float.j0 ```tomo -Float64.j0 : func(x: Float64 -> Float64) +Float.j0 : func(x: Float -> Float) ``` Computes the Bessel function of the first kind of order 0. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the Bessel function is to be calculated. | - +x | `Float` | The number for which the Bessel function is to be calculated. | - **Return:** The Bessel function of the first kind of order 0 of `x`. @@ -1056,17 +1056,17 @@ x | `Float64` | The number for which the Bessel function is to be calculated. | assert (0.0).j0() == 1 ``` -## Float64.j1 +## Float.j1 ```tomo -Float64.j1 : func(x: Float64 -> Float64) +Float.j1 : func(x: Float -> Float) ``` Computes the Bessel function of the first kind of order 1. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the Bessel function is to be calculated. | - +x | `Float` | The number for which the Bessel function is to be calculated. | - **Return:** The Bessel function of the first kind of order 1 of `x`. @@ -1076,37 +1076,37 @@ x | `Float64` | The number for which the Bessel function is to be calculated. | assert (0.0).j1() == 0 ``` -## Float64.log +## Float.log ```tomo -Float64.log : func(x: Float64 -> Float64) +Float.log : func(x: Float -> Float) ``` Computes the natural logarithm (base $e$) of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the natural logarithm is to be calculated. | - +x | `Float` | The number for which the natural logarithm is to be calculated. | - **Return:** The natural logarithm of `x`. **Example:** ```tomo -assert Float64.E.log() == 1 +assert Float.E.log() == 1 ``` -## Float64.log10 +## Float.log10 ```tomo -Float64.log10 : func(x: Float64 -> Float64) +Float.log10 : func(x: Float -> Float) ``` Computes the base-10 logarithm of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the base-10 logarithm is to be calculated. | - +x | `Float` | The number for which the base-10 logarithm is to be calculated. | - **Return:** The base-10 logarithm of `x`. @@ -1116,17 +1116,17 @@ x | `Float64` | The number for which the base-10 logarithm is to be calculated. assert (100.0).log10() == 2 ``` -## Float64.log1p +## Float.log1p ```tomo -Float64.log1p : func(x: Float64 -> Float64) +Float.log1p : func(x: Float -> Float) ``` Computes $\log(1 + x)$ for a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which $\log(1 + x)$ is to be calculated. | - +x | `Float` | The number for which $\log(1 + x)$ is to be calculated. | - **Return:** The value of $\log(1 + x)$. @@ -1136,17 +1136,17 @@ x | `Float64` | The number for which $\log(1 + x)$ is to be calculated. | - assert (1.0).log1p() == 0.6931 ``` -## Float64.log2 +## Float.log2 ```tomo -Float64.log2 : func(x: Float64 -> Float64) +Float.log2 : func(x: Float -> Float) ``` Computes the base-2 logarithm of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the base-2 logarithm is to be calculated. | - +x | `Float` | The number for which the base-2 logarithm is to be calculated. | - **Return:** The base-2 logarithm of `x`. @@ -1156,17 +1156,17 @@ x | `Float64` | The number for which the base-2 logarithm is to be calculated. assert (8.0).log2() == 3 ``` -## Float64.logb +## Float.logb ```tomo -Float64.logb : func(x: Float64 -> Float64) +Float.logb : func(x: Float -> Float) ``` Computes the binary exponent (base-2 logarithm) of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the binary exponent is to be calculated. | - +x | `Float` | The number for which the binary exponent is to be calculated. | - **Return:** The binary exponent of `x`. @@ -1176,19 +1176,19 @@ x | `Float64` | The number for which the binary exponent is to be calculated. | assert (8.0).logb() == 3 ``` -## Float64.mix +## Float.mix ```tomo -Float64.mix : func(amount: Float64, x: Float64, y: Float64 -> Float64) +Float.mix : func(amount: Float, x: Float, y: Float -> Float) ``` Interpolates between two numbers based on a given amount. Argument | Type | Description | Default ---------|------|-------------|--------- -amount | `Float64` | The interpolation factor (between `0` and `1`). | - -x | `Float64` | The starting number. | - -y | `Float64` | The ending number. | - +amount | `Float` | The interpolation factor (between `0` and `1`). | - +x | `Float` | The starting number. | - +y | `Float` | The ending number. | - **Return:** The interpolated number between `x` and `y` based on `amount`. @@ -1199,20 +1199,20 @@ assert (0.5).mix(10, 20) == 15 assert (0.25).mix(10, 20) == 12.5 ``` -## Float64.near +## Float.near ```tomo -Float64.near : func(x: Float64, y: Float64, ratio: Float64 = 1e-9, min_epsilon: Float64 = 1e-9 -> Bool) +Float.near : func(x: Float, y: Float, ratio: Float = 1e-9, min_epsilon: Float = 1e-9 -> Bool) ``` 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. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The first number. | - -y | `Float64` | The second number. | - -ratio | `Float64` | The relative tolerance. Default is `1e-9`. | `1e-9` -min_epsilon | `Float64` | The absolute tolerance. Default is `1e-9`. | `1e-9` +x | `Float` | The first number. | - +y | `Float` | The second number. | - +ratio | `Float` | The relative tolerance. Default is `1e-9`. | `1e-9` +min_epsilon | `Float` | The absolute tolerance. Default is `1e-9`. | `1e-9` **Return:** `yes` if `x` and `y` are approximately equal within the specified tolerances, `no` otherwise. @@ -1224,18 +1224,18 @@ assert (100.0).near(110, ratio=0.1) == yes assert (5.0).near(5.1, min_epsilon=0.1) == yes ``` -## Float64.nextafter +## Float.nextafter ```tomo -Float64.nextafter : func(x: Float64, y: Float64 -> Float64) +Float.nextafter : func(x: Float, y: Float -> Float) ``` Computes the next representable value after a given number towards a specified direction. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The starting number. | - -y | `Float64` | The direction towards which to find the next representable value. | - +x | `Float` | The starting number. | - +y | `Float` | The direction towards which to find the next representable value. | - **Return:** The next representable value after `x` in the direction of `y`. @@ -1245,10 +1245,10 @@ y | `Float64` | The direction towards which to find the next representable value assert (1.0).nextafter(1.1) == 1.0000000000000002 ``` -## Float64.parse +## Float.parse ```tomo -Float64.parse : func(text: Text, remainder: &Text? = none -> Float64?) +Float.parse : func(text: Text, remainder: &Text? = none -> Float?) ``` Converts a text representation of a number into a floating-point number. @@ -1263,26 +1263,26 @@ remainder | `&Text?` | If non-none, this argument will be set to the remainder o **Example:** ```tomo -assert Float64.parse("3.14") == 3.14 -assert Float64.parse("1e3") == 1000 -assert Float64.parse("1.5junk") == none +assert Float.parse("3.14") == 3.14 +assert Float.parse("1e3") == 1000 +assert Float.parse("1.5junk") == none remainder : Text -assert Float64.parse("1.5junk", &remainder) == 1.5 +assert Float.parse("1.5junk", &remainder) == 1.5 assert remainder == "junk" ``` -## Float64.percent +## Float.percent ```tomo -Float64.percent : func(n: Float64, precision: Float64 = 0.01 -> Text) +Float.percent : func(n: Float, precision: Float = 0.01 -> Text) ``` Convert a number into a percentage text with a percent sign. Argument | Type | Description | Default ---------|------|-------------|--------- -n | `Float64` | The number to be converted to a percent. | - -precision | `Float64` | Round the percentage to this precision level. | `0.01` +n | `Float` | The number to be converted to a percent. | - +precision | `Float` | Round the percentage to this precision level. | `0.01` **Return:** A text representation of the number as a percentage with a percent sign. @@ -1295,17 +1295,17 @@ assert (1./3.).percent(2, precision=0.0001) == "33.3333%" assert (1./3.).percent(2, precision=10.) == "30%" ``` -## Float64.rint +## Float.rint ```tomo -Float64.rint : func(x: Float64 -> Float64) +Float.rint : func(x: Float -> Float) ``` Rounds a number to the nearest integer, with ties rounded to the nearest even integer. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number to be rounded. | - +x | `Float` | The number to be rounded. | - **Return:** The nearest integer value of `x`. @@ -1316,17 +1316,17 @@ assert (3.5).rint() == 4 assert (2.5).rint() == 2 ``` -## Float64.round +## Float.round ```tomo -Float64.round : func(x: Float64 -> Float64) +Float.round : func(x: Float -> Float) ``` Rounds a number to the nearest whole number integer. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number to be rounded. | - +x | `Float` | The number to be rounded. | - **Return:** The nearest integer value of `x`. @@ -1337,17 +1337,17 @@ assert (2.3).round() == 2 assert (2.7).round() == 3 ``` -## Float64.significand +## Float.significand ```tomo -Float64.significand : func(x: Float64 -> Float64) +Float.significand : func(x: Float -> Float) ``` Extracts the significand (or mantissa) of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number from which to extract the significand. | - +x | `Float` | The number from which to extract the significand. | - **Return:** The significand of `x`. @@ -1357,17 +1357,17 @@ x | `Float64` | The number from which to extract the significand. | - assert (1234.567).significand() == 0.1234567 ``` -## Float64.sin +## Float.sin ```tomo -Float64.sin : func(x: Float64 -> Float64) +Float.sin : func(x: Float -> Float) ``` Computes the sine of a number (angle in radians). Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The angle in radians. | - +x | `Float` | The angle in radians. | - **Return:** The sine of `x`. @@ -1377,17 +1377,17 @@ x | `Float64` | The angle in radians. | - assert (0.0).sin() == 0 ``` -## Float64.sinh +## Float.sinh ```tomo -Float64.sinh : func(x: Float64 -> Float64) +Float.sinh : func(x: Float -> Float) ``` Computes the hyperbolic sine of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the hyperbolic sine is to be calculated. | - +x | `Float` | The number for which the hyperbolic sine is to be calculated. | - **Return:** The hyperbolic sine of `x`. @@ -1397,17 +1397,17 @@ x | `Float64` | The number for which the hyperbolic sine is to be calculated. | assert (0.0).sinh() == 0 ``` -## Float64.sqrt +## Float.sqrt ```tomo -Float64.sqrt : func(x: Float64 -> Float64) +Float.sqrt : func(x: Float -> Float) ``` Computes the square root of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the square root is to be calculated. | - +x | `Float` | The number for which the square root is to be calculated. | - **Return:** The square root of `x`. @@ -1417,17 +1417,17 @@ x | `Float64` | The number for which the square root is to be calculated. | - assert (16.0).sqrt() == 4 ``` -## Float64.tan +## Float.tan ```tomo -Float64.tan : func(x: Float64 -> Float64) +Float.tan : func(x: Float -> Float) ``` Computes the tangent of a number (angle in radians). Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The angle in radians. | - +x | `Float` | The angle in radians. | - **Return:** The tangent of `x`. @@ -1437,17 +1437,17 @@ x | `Float64` | The angle in radians. | - assert (0.0).tan() == 0 ``` -## Float64.tanh +## Float.tanh ```tomo -Float64.tanh : func(x: Float64 -> Float64) +Float.tanh : func(x: Float -> Float) ``` Computes the hyperbolic tangent of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the hyperbolic tangent is to be calculated. | - +x | `Float` | The number for which the hyperbolic tangent is to be calculated. | - **Return:** The hyperbolic tangent of `x`. @@ -1457,17 +1457,17 @@ x | `Float64` | The number for which the hyperbolic tangent is to be calculated. assert (0.0).tanh() == 0 ``` -## Float64.tgamma +## Float.tgamma ```tomo -Float64.tgamma : func(x: Float64 -> Float64) +Float.tgamma : func(x: Float -> Float) ``` Computes the gamma function of a number. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the gamma function is to be calculated. | - +x | `Float` | The number for which the gamma function is to be calculated. | - **Return:** The gamma function of `x`. @@ -1477,17 +1477,17 @@ x | `Float64` | The number for which the gamma function is to be calculated. | assert (1.0).tgamma() == 1 ``` -## Float64.trunc +## Float.trunc ```tomo -Float64.trunc : func(x: Float64 -> Float64) +Float.trunc : func(x: Float -> Float) ``` Truncates a number to the nearest integer towards zero. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number to be truncated. | - +x | `Float` | The number to be truncated. | - **Return:** The integer part of `x` towards zero. @@ -1498,18 +1498,18 @@ assert (3.7).trunc() == 3 assert (-3.7).trunc() == -3 ``` -## Float64.with_precision +## Float.with_precision ```tomo -Float64.with_precision : func(n: Float64, precision: Float64 -> Float64) +Float.with_precision : func(n: Float, precision: Float -> Float) ``` Round a number to the given precision level (specified as `10`, `.1`, `.001` etc). Argument | Type | Description | Default ---------|------|-------------|--------- -n | `Float64` | The number to be rounded to a given precision. | - -precision | `Float64` | The precision to which the number should be rounded. | - +n | `Float` | The number to be rounded to a given precision. | - +precision | `Float` | The precision to which the number should be rounded. | - **Return:** The number, rounded to the given precision level. @@ -1521,17 +1521,17 @@ assert (123456.).with_precision(100) == 123500 assert (1234567.).with_precision(5) == 1234565 ``` -## Float64.y0 +## Float.y0 ```tomo -Float64.y0 : func(x: Float64 -> Float64) +Float.y0 : func(x: Float -> Float) ``` Computes the Bessel function of the second kind of order 0. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the Bessel function is to be calculated. | - +x | `Float` | The number for which the Bessel function is to be calculated. | - **Return:** The Bessel function of the second kind of order 0 of `x`. @@ -1541,17 +1541,17 @@ x | `Float64` | The number for which the Bessel function is to be calculated. | assert (1.0).y0() == -0.7652 ``` -## Float64.y1 +## Float.y1 ```tomo -Float64.y1 : func(x: Float64 -> Float64) +Float.y1 : func(x: Float -> Float) ``` Computes the Bessel function of the second kind of order 1. Argument | Type | Description | Default ---------|------|-------------|--------- -x | `Float64` | The number for which the Bessel function is to be calculated. | - +x | `Float` | The number for which the Bessel function is to be calculated. | - **Return:** The Bessel function of the second kind of order 1 of `x`. -- cgit v1.2.3