Repository: mattwparas/steel
Pull request #318: Added documentation to numbers.rs
Author: login: gold-silver-copper
Created: 2025-03-02T09:40:40Z | Merged: 2025-03-13T03:55:45Z

I added documentation to the remainder operator, and the trigonometry operators. Modified the modulo operator doc a bit. Added a TODO to exact operator.

This is my first contribution to this project, please let me know if there's anything I can do better. Thank you, I look forward to contributing more in the future.


Diff:
diff --git a/crates/steel-core/src/primitives/numbers.rs b/crates/steel-core/src/primitives/numbers.rs
index 9b34fbcac..8457fa4c2 100644
--- a/crates/steel-core/src/primitives/numbers.rs
+++ b/crates/steel-core/src/primitives/numbers.rs
@@ -382,7 +382,8 @@ pub fn quotient(args: &[SteelVal]) -> Result<SteelVal> {
     }
 }
 
-/// Returns the remainder of the division of the first number by the second
+/// Returns the euclidean remainder of the division of the first number by the second
+/// This differs from the remainder operator when using negative numbers.
 ///
 /// (modulo n m) -> integer?
 ///
@@ -407,6 +408,21 @@ pub fn modulo(args: &[SteelVal]) -> Result<SteelVal> {
     }
 }
 
+/// Returns the arithmetic remainder of the division of the first number by the second.
+/// This differs from the modulo operator when using negative numbers.
+///
+/// (remainder n m) -> integer?
+///
+/// * n : integer?
+/// * m : integer?
+///
+/// # Examples
+/// ```scheme
+/// > (remainder 10 3) ;; => 1
+/// > (remainder -10 3) ;; => -1
+/// > (remainder 10 -3) ;; => 1
+/// > (remainder -10 -3) ;; => -1
+/// ```
 #[steel_derive::native(name = "remainder", constant = true, arity = "Exact(2)")]
 pub fn remainder(args: &[SteelVal]) -> Result<SteelVal> {
     match &args {
@@ -418,7 +434,19 @@ pub fn remainder(args: &[SteelVal]) -> Result<SteelVal> {
     }
 }
 
-// TODO: Do this for sin, cos, tan, asin, acos, atan
+/// Returns the sine value of the input angle, measured in radians.
+///
+/// (sin n) -> number?
+///
+/// * n : number? - The input angle, in radians.
+///
+/// # Examples
+/// ```scheme
+/// > (sin 0) ;; => 0
+/// > (sin 1) ;; => 0.8414709848078965
+/// > (sin 2.0) ;; => 0.9092974268256817
+/// > (sin 3.14) ;; => 0.0015926529164868282
+/// ```
 #[steel_derive::function(name = "sin", constant = true)]
 pub fn sin(arg: &SteelVal) -> Result<SteelVal> {
     match arg {
@@ -431,6 +459,19 @@ pub fn sin(arg: &SteelVal) -> Result<SteelVal> {
     .into_steelval()
 }
 
+/// Returns the cosine value of the input angle, measured in radians.
+///
+/// (cos n) -> number?
+///
+/// * n : number? - The input angle, in radians.
+///
+/// # Examples
+/// ```scheme
+/// > (cos 0) ;; => 1
+/// > (cos 1) ;; => 0.5403023058681398
+/// > (cos 2.0) ;; => -0.4161468365471424
+/// > (cos 3.14) ;; => -0.9999987317275395
+/// ```
 #[steel_derive::function(name = "cos", constant = true)]
 pub fn cos(arg: &SteelVal) -> Result<SteelVal> {
     match arg {
@@ -443,6 +484,19 @@ pub fn cos(arg: &SteelVal) -> Result<SteelVal> {
     .into_steelval()
 }
 
+/// Returns the tangent value of the input angle, measured in radians.
+///
+/// (tan n) -> number?
+///
+/// * n : number? - The input angle, in radians.
+///
+/// # Examples
+/// ```scheme
+/// > (tan 0) ;; => 0
+/// > (tan 1) ;; => 1.557407724654902
+/// > (tan 2.0) ;; => -2.185039863261519
+/// > (tan 3.14) ;; => -0.0015926549364072232
+/// ```
 #[steel_derive::function(name = "tan", constant = true)]
 pub fn tan(arg: &SteelVal) -> Result<SteelVal> {
     match arg {
@@ -455,6 +509,19 @@ pub fn tan(arg: &SteelVal) -> Result<SteelVal> {
     .into_steelval()
 }
 
+/// Returns the arcsine, or inverse sine, of a value; output is in radians.
+///
+/// (asin n) -> number?
+///
+/// * n : number? - The input value is the sine of the angle you want and must be from -1 to 1.
+///
+/// # Examples
+/// ```scheme
+/// > (asin -1) ;; => -1.5707963267948966
+/// > (asin 0) ;; => 0
+/// > (asin 0.5) ;; => 0.5235987755982988
+/// > (asin 2) ;; => +nan.0
+/// ```
 #[steel_derive::function(name = "asin", constant = true)]
 pub fn asin(arg: &SteelVal) -> Result<SteelVal> {
     match arg {
@@ -467,6 +534,19 @@ pub fn asin(arg: &SteelVal) -> Result<SteelVal> {
     .into_steelval()
 }
 
+/// Returns the arccosine, or inverse cosine, of a value; output is in radians.
+///
+/// (acos n) -> number?
+///
+/// * n : number? - The input value is the cosine of the angle you want and must be from -1 to 1.
+///
+/// # Examples
+/// ```scheme
+/// > (acos -1) ;; => 3.141592653589793
+/// > (acos 0) ;; => 1.5707963267948966
+/// > (acos 0.5) ;; => 1.0471975511965976
+/// > (acos 2) ;; => +nan.0
+/// ```
 #[steel_derive::function(name = "acos", constant = true)]
 pub fn acos(arg: &SteelVal) -> Result<SteelVal> {
     match arg {
@@ -479,6 +559,19 @@ pub fn acos(arg: &SteelVal) -> Result<SteelVal> {
     .into_steelval()
 }
 
+/// Returns the arctangent, or inverse tangent, of a value; output is in radians.
+///
+/// (atan n) -> number?
+///
+/// * n : number? - The input value is the tangent of the angle you want.
+///
+/// # Examples
+/// ```scheme
+/// > (atan -1) ;; => -0.7853981633974483
+/// > (atan 0) ;; => 0
+/// > (atan 0.5) ;; => 0.46364760900080615
+/// > (atan 2) ;; => 1.1071487177940906
+/// ```
 #[steel_derive::function(name = "atan", constant = true)]
 pub fn atan(arg: &SteelVal) -> Result<SteelVal> {
     match arg {
@@ -562,6 +655,18 @@ pub fn exactp(value: &SteelVal) -> bool {
     }
 }
 
+/// Returns an exact representation of the input number, coerces an inexact number to an exact form.
+///
+/// (exact n) -> number?
+///
+/// * n : number? - The value to check for exactness.
+///
+/// # Examples
+/// ```scheme
+/// > (exact 5.0) ;; => 5
+/// > (exact 5/3) ;; => 5/3
+/// > (exact 2) ;; => 2
+/// ```
 #[steel_derive::function(name = "exact", constant = true)]
 pub fn exact(value: &SteelVal) -> Result<SteelVal> {
     match value {
diff --git a/docs/src/builtins/steel_base.md b/docs/src/builtins/steel_base.md
index 5255a99c1..463f5c0b4 100644
--- a/docs/src/builtins/steel_base.md
+++ b/docs/src/builtins/steel_base.md
@@ -133,6 +133,20 @@ Computes the absolute value of the given number.
 > (abs -42) ;; => 42
 > (abs 0) ;; => 0
 ```
+### **acos**
+Returns the arccosine, or inverse cosine, of a value; output is in radians.
+
+(acos n) -> number?
+
+* n : number? - The input value is the cosine of the angle you want and must be from -1 to 1.
+
+#### Examples
+```scheme
+> (acos -1) ;; => 3.141592653589793
+> (acos 0) ;; => 1.5707963267948966
+> (acos 0.5) ;; => 1.0471975511965976
+> (acos 2) ;; => +nan.0
+```
 ### **append**
 Appends the given lists together. If provided with no lists, will return the empty list.
 
@@ -158,6 +172,34 @@ Applies the given `function` with arguments as the contents of the `list`.
 > (apply + (list 1 2 3 4)) ;; => 10
 > (apply list (list 1 2 3 4)) ;; => '(1 2 3 4)
 ```
+### **asin**
+Returns the arcsine, or inverse sine, of a value; output is in radians.
+
+(asin n) -> number?
+
+* n : number? - The input value is the sine of the angle you want and must be from -1 to 1.
+
+#### Examples
+```scheme
+> (asin -1) ;; => -1.5707963267948966
+> (asin 0) ;; => 0
+> (asin 0.5) ;; => 0.5235987755982988
+> (asin 2) ;; => +nan.0
+```
+### **atan**
+Returns the arctangent, or inverse tangent, of a value; output is in radians.
+
+(atan n) -> number?
+
+* n : number? - The input value is the tangent of the angle you want.
+
+#### Examples
+```scheme
+> (atan -1) ;; => -0.7853981633974483
+> (atan 0) ;; => 0
+> (atan 0.5) ;; => 0.46364760900080615
+> (atan 2) ;; => 1.1071487177940906
+```
 ### **byte?**
 Returns `#t` if the given value is a byte, meaning an exact
 integer between 0 and 255 inclusive, `#f` otherwise.
@@ -418,6 +460,20 @@ Returns a newly allocated list whose first element is `a` and second element is
 ```
 ### **copy-directory-recursively!**
 Recursively copies the directory from source to destination
+### **cos**
+Returns the cosine value of the input angle, measured in radians.
+
+(cos n) -> number?
+
+* n : number? - The input angle, in radians.
+
+#### Examples
+```scheme
+> (cos 0) ;; => 1
+> (cos 1) ;; => 0.5403023058681398
+> (cos 2.0) ;; => -0.4161468365471424
+> (cos 3.14) ;; => -0.9999987317275395
+```
 ### **create-directory!**
 Creates the directory
 ### **current-directory**
@@ -504,6 +560,18 @@ Returns `#t` if the value is an EOF object.
 Returns the message of an error object.
 
 (error-object-message error?) -> string?
+### **exact**
+Returns the input value if it is an exact number, otherwise raises an error.
+
+(exact n) -> number?
+
+* n : number? - The value to check for exactness.
+
+#### Examples
+```scheme
+> (exact 5) ;; => 5
+> (exact 5/3) ;; => 5/3
+```
 ### **exact->inexact**
 Converts an exact number to an inexact number.
 
@@ -778,6 +846,21 @@ Gets the `key` from the given `map`. Raises an error if the key does not exist.
 ```scheme
 > (hash-ref (hash 'a 10 'b 20) 'b) ;; => 20
 ```
+### **hash-remove**
+Returns a new hashmap with the given key removed. Performs a functional
+update, so the old hash map is still available with the original key value pair.
+
+(hash-remove map key) -> hash?
+
+* map : hash?
+* key : any/c
+
+#### Examples
+```scheme
+> (hash-remove (hash 'a 10 'b 20) 'a)
+
+=> '#hash(('b . 20))
+```
 ### **hash-try-get**
 Gets the `key` from the given `map`. Returns #false if the key does not exist.
 
@@ -1129,7 +1212,8 @@ Creates a thread local storage slot. These slots are static, and will _not_ be r
 When spawning a new thread, the value inside will be shared into that slot, however
 future updates to the slot will be local to that thread.
 ### **modulo**
-Returns the remainder of the division of the first number by the second
+Returns the euclidean remainder of the division of the first number by the second
+This differs from the remainder operator when using negative numbers.
 
 (modulo n m) -> integer?
 
@@ -1404,6 +1488,22 @@ Blocks until one of the channels passed in is ready to receive.
 Returns the index of the channel arguments passed in which is ready.
 
 Using this directly is not recommended.
+### **remainder**
+Returns the arithmetic remainder of the division of the first number by the second.
+This differs from the modulo operator when using negative numbers.
+
+(remainder n m) -> integer?
+
+* n : integer?
+* m : integer?
+
+#### Examples
+```scheme
+> (remainder 10 3) ;; => 1
+> (remainder -10 3) ;; => -1
+> (remainder 10 -3) ;; => 1
+> (remainder -10 -3) ;; => -1
+```
 ### **rest**
 Returns the rest of the list. Will raise an error if the list is empty.
 
@@ -1467,6 +1567,20 @@ error[E11]: Generic
 ### **set-tls!**
 Set the value in the the thread local storage. Only this thread will see the updates associated
 with this TLS.
+### **sin**
+Returns the sine value of the input angle, measured in radians.
+
+(sin n) -> number?
+
+* n : number? - The input angle, in radians.
+
+#### Examples
+```scheme
+> (sin 0) ;; => 0
+> (sin 1) ;; => 0.8414709848078965
+> (sin 2.0) ;; => 0.9092974268256817
+> (sin 3.14) ;; => 0.0015926529164868282
+```
 ### **spawn-native-thread**
 Spawns the given `func` on another thread. It is required that the arity of the
 given function be 0. If the arity of the given function cannot be checked until runtime,
@@ -1818,6 +1932,20 @@ Returns the first n elements of the list l as a new list.
 > (take '(1 2 3 4) 2) ;; => '(0 1)
 > (take (range 0 10) 4) ;; => '(0 1 2 3)
 ```
+### **tan**
+Returns the tangent value of the input angle, measured in radians.
+
+(tan n) -> number?
+
+* n : number? - The input angle, in radians.
+
+#### Examples
+```scheme
+> (tan 0) ;; => 0
+> (tan 1) ;; => 1.557407724654902
+> (tan 2.0) ;; => -2.185039863261519
+> (tan 3.14) ;; => -0.0015926549364072232
+```
 ### **third**
 Get the third element of the list. Raises an error if the list does not have an element in the third position.
 
@@ -1987,13 +2115,10 @@ Checks if the given real number is zero.
 ### **Some->value**
 ### **Some?**
 ### **TypeId?**
-### **acos**
 ### **active-object-count**
 ### **arithmetic-shift**
 ### **arity?**
-### **asin**
 ### **assert!**
-### **atan**
 ### **atom?**
 ### **attach-contract-struct!**
 ### **block-on**
@@ -2027,7 +2152,6 @@ Checks if the given real number is zero.
 ### **compose**
 ### **concat-symbols**
 ### **continuation?**
-### **cos**
 ### **current-function-span**
 ### **current-os!**
 ### **current-thread-id**
@@ -2047,7 +2171,6 @@ Checks if the given real number is zero.
 ### **eval!**
 ### **eval-string**
 ### **even?**
-### **exact**
 ### **expand!**
 ### **extending**
 ### **f+**
@@ -2088,6 +2211,7 @@ Checks if the given real number is zero.
 ### **kill**
 ### **list->string**
 ### **list->vector**
+### **list-chunks**
 ### **list-drop**
 ### **list-tail**
 ### **list?**
@@ -2138,7 +2262,6 @@ Checks if the given real number is zero.
 ### **read!**
 ### **read-line-from-port**
 ### **read-to-string**
-### **remainder**
 ### **run!**
 ### **set-box!**
 ### **set-current-dir!**
@@ -2147,7 +2270,6 @@ Checks if the given real number is zero.
 ### **set-strong-box!**
 ### **set-test-mode!**
 ### **set?**
-### **sin**
 ### **span-file-id**
 ### **spawn-process**
 ### **spawn-thread!**
@@ -2170,7 +2292,6 @@ Checks if the given real number is zero.
 ### **syntax/loc**
 ### **syntax?**
 ### **taking**
-### **tan**
 ### **thread/available-parallelism**
 ### **thread::current/id**
 ### **transduce**
diff --git a/docs/src/builtins/steel_hash.md b/docs/src/builtins/steel_hash.md
index 6b5b61800..efe9f0bce 100644
--- a/docs/src/builtins/steel_hash.md
+++ b/docs/src/builtins/steel_hash.md
@@ -129,6 +129,21 @@ Gets the `key` from the given `map`. Raises an error if the key does not exist.
 ```scheme
 > (hash-ref (hash 'a 10 'b 20) 'b) ;; => 20
 ```
+### **hash-remove**
+Returns a new hashmap with the given key removed. Performs a functional
+update, so the old hash map is still available with the original key value pair.
+
+(hash-remove map key) -> hash?
+
+* map : hash?
+* key : any/c
+
+#### Examples
+```scheme
+> (hash-remove (hash 'a 10 'b 20) 'a)
+
+=> '#hash(('b . 20))
+```
 ### **hash-try-get**
 Gets the `key` from the given `map`. Returns #false if the key does not exist.
 
diff --git a/docs/src/builtins/steel_lists.md b/docs/src/builtins/steel_lists.md
index 23d80c2cd..f3340a531 100644
--- a/docs/src/builtins/steel_lists.md
+++ b/docs/src/builtins/steel_lists.md
@@ -268,6 +268,7 @@ error[E11]: Generic
 ### **cdr-null?**
 ### **list->string**
 ### **list->vector**
+### **list-chunks**
 ### **list-drop**
 ### **list-tail**
 ### **plist-get**
diff --git a/docs/src/builtins/steel_numbers.md b/docs/src/builtins/steel_numbers.md
index f06e45d96..17f150fd1 100644
--- a/docs/src/builtins/steel_numbers.md
+++ b/docs/src/builtins/steel_numbers.md
@@ -65,6 +65,48 @@ Computes the absolute value of the given number.
 > (abs -42) ;; => 42
 > (abs 0) ;; => 0
 ```
+### **acos**
+Returns the arccosine, or inverse cosine, of a value; output is in radians.
+
+(acos n) -> number?
+
+* n : number? - The input value is the cosine of the angle you want and must be from -1 to 1.
+
+#### Examples
+```scheme
+> (acos -1) ;; => 3.141592653589793
+> (acos 0) ;; => 1.5707963267948966
+> (acos 0.5) ;; => 1.0471975511965976
+> (acos 2) ;; => +nan.0
+```
+### **asin**
+Returns the arcsine, or inverse sine, of a value; output is in radians.
+
+(asin n) -> number?
+
+* n : number? - The input value is the sine of the angle you want and must be from -1 to 1.
+
+#### Examples
+```scheme
+> (asin -1) ;; => -1.5707963267948966
+> (asin 0) ;; => 0
+> (asin 0.5) ;; => 0.5235987755982988
+> (asin 2) ;; => +nan.0
+```
+### **atan**
+Returns the arctangent, or inverse tangent, of a value; output is in radians.
+
+(atan n) -> number?
+
+* n : number? - The input value is the tangent of the angle you want.
+
+#### Examples
+```scheme
+> (atan -1) ;; => -0.7853981633974483
+> (atan 0) ;; => 0
+> (atan 0.5) ;; => 0.46364760900080615
+> (atan 2) ;; => 1.1071487177940906
+```
 ### **ceiling**
 Rounds the given number up to the nearest integer not less than it.
 
@@ -78,6 +120,20 @@ Rounds the given number up to the nearest integer not less than it.
 > (ceiling 42.1) ;; => 43
 > (ceiling -42.1) ;; => -42
 ```
+### **cos**
+Returns the cosine value of the input angle, measured in radians.
+
+(cos n) -> number?
+
+* n : number? - The input angle, in radians.
+
+#### Examples
+```scheme
+> (cos 0) ;; => 1
+> (cos 1) ;; => 0.5403023058681398
+> (cos 2.0) ;; => -0.4161468365471424
+> (cos 3.14) ;; => -0.9999987317275395
+```
 ### **denominator**
 Retrieves the denominator of the given rational number.
 
@@ -91,6 +147,18 @@ Retrieves the denominator of the given rational number.
 > (denominator 3/4) ;; => 4
 > (denominator 4) ;; => 1
 ```
+### **exact**
+Returns the input value if it is an exact number, otherwise raises an error.
+
+(exact n) -> number?
+
+* n : number? - The value to check for exactness.
+
+#### Examples
+```scheme
+> (exact 5) ;; => 5
+> (exact 5/3) ;; => 5/3
+```
 ### **exact->inexact**
 Converts an exact number to an inexact number.
 
@@ -250,7 +318,8 @@ Computes the magnitude of the given number.
 > (magnitude -5) ;; => 5
 ```
 ### **modulo**
-Returns the remainder of the division of the first number by the second
+Returns the euclidean remainder of the division of the first number by the second
+This differs from the remainder operator when using negative numbers.
 
 (modulo n m) -> integer?
 
@@ -328,6 +397,22 @@ Returns quotient of dividing numerator by denomintator.
 > (quotient 10 2) ;; => 5
 > (quotient -10 2) ;; => -5
 ```
+### **remainder**
+Returns the arithmetic remainder of the division of the first number by the second.
+This differs from the modulo operator when using negative numbers.
+
+(remainder n m) -> integer?
+
+* n : integer?
+* m : integer?
+
+#### Examples
+```scheme
+> (remainder 10 3) ;; => 1
+> (remainder -10 3) ;; => -1
+> (remainder 10 -3) ;; => 1
+> (remainder -10 -3) ;; => -1
+```
 ### **round**
 Rounds the given number to the nearest integer.
 
@@ -341,6 +426,20 @@ Rounds the given number to the nearest integer.
 > (round 4.6) ;; => 5
 > (round -2.5) ;; => -3
 ```
+### **sin**
+Returns the sine value of the input angle, measured in radians.
+
+(sin n) -> number?
+
+* n : number? - The input angle, in radians.
+
+#### Examples
+```scheme
+> (sin 0) ;; => 0
+> (sin 1) ;; => 0.8414709848078965
+> (sin 2.0) ;; => 0.9092974268256817
+> (sin 3.14) ;; => 0.0015926529164868282
+```
 ### **sqrt**
 Computes the square root of the given number.
 
@@ -367,6 +466,20 @@ Computes the square of the given number.
 > (square -3) ;; => 9
 > (square 2.5) ;; => 6.25
 ```
+### **tan**
+Returns the tangent value of the input angle, measured in radians.
+
+(tan n) -> number?
+
+* n : number? - The input angle, in radians.
+
+#### Examples
+```scheme
+> (tan 0) ;; => 0
+> (tan 1) ;; => 1.557407724654902
+> (tan 2.0) ;; => -2.185039863261519
+> (tan 3.14) ;; => -0.0015926549364072232
+```
 ### **zero?**
 Checks if the given real number is zero.
 
@@ -380,15 +493,7 @@ Checks if the given real number is zero.
 > (zero? 0.0) ;; => #t
 > (zero? 0.1) ;; => #f
 ```
-### **acos**
 ### **arithmetic-shift**
-### **asin**
-### **atan**
-### **cos**
 ### **even?**
-### **exact**
 ### **f+**
 ### **odd?**
-### **remainder**
-### **sin**
-### **tan**
diff --git a/docs/src/builtins/steel_tcp.md b/docs/src/builtins/steel_tcp.md
index 922ecb5bf..b4848ee0e 100644
--- a/docs/src/builtins/steel_tcp.md
+++ b/docs/src/builtins/steel_tcp.md
@@ -4,6 +4,7 @@
 ### **tcp-connect**
 ### **tcp-listen**
 ### **tcp-listener-set-non-blocking!**
+### **tcp-shutdown!**
 ### **tcp-stream-buffered-reader**
 ### **tcp-stream-reader**
 ### **tcp-stream-set-non-blocking!**


Reviews:
user: login: mattwparas
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-04T04:53:10Z
user: login: mattwparas
body: One comment, otherwise LGTM
state: CHANGES_REQUESTED
author_association: OWNER
submitted_at: 2025-03-07T04:42:24Z
user: login: gold-silver-copper
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T07:58:41Z
user: login: mattwparas
state: APPROVED
author_association: OWNER
submitted_at: 2025-03-11T03:19:26Z

Review comments:
diff_hunk: @@ -562,6 +655,7 @@ pub fn exactp(value: &SteelVal) -> bool {
     }
 }
 
+/// TODO ?
path: crates/steel-core/src/primitives/numbers.rs
user: login: mattwparas
body: I'm fine to leave the todo in - but can you make it `//` instead of a doc comment `///` - otherwise it'll show up as todo in the docs itself
created_at: 2025-03-04T04:53:10Z
author_association: OWNER
diff_hunk: @@ -562,6 +655,17 @@ pub fn exactp(value: &SteelVal) -> bool {
     }
 }
 
+/// Returns the input value if it is an exact number, otherwise raises an error.
path: crates/steel-core/src/primitives/numbers.rs
user: login: mattwparas
body: Nit - I think this should say that this returns an exact representation of the input number, since it does coerce an inexact number to an exact form of it
created_at: 2025-03-07T04:42:04Z
author_association: OWNER
diff_hunk: @@ -562,6 +655,17 @@ pub fn exactp(value: &SteelVal) -> bool {
     }
 }
 
+/// Returns the input value if it is an exact number, otherwise raises an error.
path: crates/steel-core/src/primitives/numbers.rs
user: login: gold-silver-copper
body: Thank you for the explanation, I changed the header and added a relevant example.
created_at: 2025-03-07T07:58:41Z
author_association: CONTRIBUTOR

PR comments:
user: login: gold-silver-copper
created_at: 2025-03-04T03:20:59Z
body: I will work on adding docs to other files in separate PRs for now.
author_association: CONTRIBUTOR
user: login: mattwparas
created_at: 2025-03-04T04:54:43Z
body: When you're happy with the docs, can you also run `cargo xtask docgen` to generate the docs that go on the site? I have those get checked in manually for now. I'd like to get them to be generated by the CI, but I haven't gotten around to that quite yet.
author_association: OWNER
user: login: gold-silver-copper
created_at: 2025-03-04T07:02:53Z
body: I added docs to the exact operator, and generated docs for the site. All the exposed functions in numbers.rs are now documented... until new ones get added. I think this PR is ready.

Edit: I found a few undocumented functions in number.rs that didnt have a 'steel_derive::function(name=...)' decorator, such as even? and odd? . I tried adding docs above their function definitions and generating web docs, but it did not generate them properly.
author_association: CONTRIBUTOR
user: login: mattwparas
created_at: 2025-03-04T14:51:21Z
body: Yeah, if they don't have the macro the docs won't get picked up, so some of the older function definitions haven't been converted to use that yet
author_association: OWNER
user: login: mattwparas
created_at: 2025-03-07T04:39:31Z
body: > I added docs to the exact operator, and generated docs for the site. All the exposed functions in numbers.rs are now documented... until new ones get added. I think this PR is ready.
> 
> Edit: I found a few undocumented functions in number.rs that didnt have a 'steel_derive::function(name=...)' decorator, such as even? and odd? . I tried adding docs above their function definitions and generating web docs, but it did not generate them properly.



> I added docs to the exact operator, and generated docs for the site. All the exposed functions in numbers.rs are now documented... until new ones get added. I think this PR is ready.
> 
> Edit: I found a few undocumented functions in number.rs that didnt have a 'steel_derive::function(name=...)' decorator, such as even? and odd? . I tried adding docs above their function definitions and generating web docs, but it did not generate them properly.

yeah, so those will need to be adjusted, the way they're bound to the module isn't the same as the way the other docs are added. No need to do this in this PR though
author_association: OWNER
user: login: mattwparas
created_at: 2025-03-11T03:19:42Z
body: Thank you!
author_association: OWNER