aboutsummaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-01-17 19:00:47 +0000
committergingerBill <bill@gingerbill.org>2022-01-17 19:00:47 +0000
commitc85ac955f798fefd149a5eeaecabf0713210b152 (patch)
treeef9ca75b6f5cfc1630314c19ea0a7a9378f89b5d /core/math
parent97922406fec4296ce0732d1eefa0b9d7c943086f (diff)
Simplify docs to hide the copyright
Diffstat (limited to 'core/math')
-rw-r--r--core/math/big/api.odin6
-rw-r--r--core/math/big/common.odin6
-rw-r--r--core/math/big/doc.odin28
-rw-r--r--core/math/big/helpers.odin6
-rw-r--r--core/math/big/internal.odin26
-rw-r--r--core/math/big/logical.odin2
-rw-r--r--core/math/big/prime.odin2
-rw-r--r--core/math/big/private.odin2
-rw-r--r--core/math/big/public.odin2
-rw-r--r--core/math/big/radix.odin2
-rw-r--r--core/math/big/tune.odin2
11 files changed, 47 insertions, 37 deletions
diff --git a/core/math/big/api.odin b/core/math/big/api.odin
index c9be04da0..bf19e83b6 100644
--- a/core/math/big/api.odin
+++ b/core/math/big/api.odin
@@ -2,12 +2,10 @@
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
Made available under Odin's BSD-3 license.
- An arbitrary precision mathematics implementation in Odin.
- For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
- The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
-
This file collects public proc maps and their aliases.
*/
+
+
package math_big
/*
diff --git a/core/math/big/common.odin b/core/math/big/common.odin
index 31ad54b14..2b34a9163 100644
--- a/core/math/big/common.odin
+++ b/core/math/big/common.odin
@@ -1,11 +1,9 @@
/*
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
Made available under Odin's BSD-3 license.
-
- An arbitrary precision mathematics implementation in Odin.
- For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
- The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
*/
+
+
package math_big
import "core:intrinsics"
diff --git a/core/math/big/doc.odin b/core/math/big/doc.odin
new file mode 100644
index 000000000..f5e0900f5
--- /dev/null
+++ b/core/math/big/doc.odin
@@ -0,0 +1,28 @@
+/*
+A BigInt implementation in Odin.
+For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
+The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
+
+========================== Low-level routines ==========================
+
+IMPORTANT: `internal_*` procedures make certain assumptions about their input.
+
+The public functions that call them are expected to satisfy their sanity check requirements.
+This allows `internal_*` call `internal_*` without paying this overhead multiple times.
+
+Where errors can occur, they are of course still checked and returned as appropriate.
+
+When importing `math:core/big` to implement an involved algorithm of your own, you are welcome
+to use these procedures instead of their public counterparts.
+
+Most inputs and outputs are expected to be passed an initialized `Int`, for example.
+Exceptions include `quotient` and `remainder`, which are allowed to be `nil` when the calling code doesn't need them.
+
+Check the comments above each `internal_*` implementation to see what constraints it expects to have met.
+
+We pass the custom allocator to procedures by default using the pattern `context.allocator = allocator`.
+This way we don't have to add `, allocator` at the end of each call.
+
+TODO: Handle +/- Infinity and NaN.
+*/
+package math_big
diff --git a/core/math/big/helpers.odin b/core/math/big/helpers.odin
index 6d13d32bb..6c4b5dd01 100644
--- a/core/math/big/helpers.odin
+++ b/core/math/big/helpers.odin
@@ -1,11 +1,9 @@
/*
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
Made available under Odin's BSD-3 license.
-
- An arbitrary precision mathematics implementation in Odin.
- For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
- The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
*/
+
+
package math_big
import "core:intrinsics"
diff --git a/core/math/big/internal.odin b/core/math/big/internal.odin
index 437f6e5fc..5085898e5 100644
--- a/core/math/big/internal.odin
+++ b/core/math/big/internal.odin
@@ -2,33 +2,9 @@
/*
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
Made available under Odin's BSD-3 license.
+*/
- A BigInt implementation in Odin.
- For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
- The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
-
- ========================== Low-level routines ==========================
-
- IMPORTANT: `internal_*` procedures make certain assumptions about their input.
-
- The public functions that call them are expected to satisfy their sanity check requirements.
- This allows `internal_*` call `internal_*` without paying this overhead multiple times.
-
- Where errors can occur, they are of course still checked and returned as appropriate.
-
- When importing `math:core/big` to implement an involved algorithm of your own, you are welcome
- to use these procedures instead of their public counterparts.
-
- Most inputs and outputs are expected to be passed an initialized `Int`, for example.
- Exceptions include `quotient` and `remainder`, which are allowed to be `nil` when the calling code doesn't need them.
-
- Check the comments above each `internal_*` implementation to see what constraints it expects to have met.
-
- We pass the custom allocator to procedures by default using the pattern `context.allocator = allocator`.
- This way we don't have to add `, allocator` at the end of each call.
- TODO: Handle +/- Infinity and NaN.
-*/
package math_big
import "core:mem"
diff --git a/core/math/big/logical.odin b/core/math/big/logical.odin
index e7e55cc47..b5de4cabf 100644
--- a/core/math/big/logical.odin
+++ b/core/math/big/logical.odin
@@ -8,6 +8,8 @@
This file contains logical operations like `and`, `or` and `xor`.
*/
+
+
package math_big
/*
diff --git a/core/math/big/prime.odin b/core/math/big/prime.odin
index eb0cd644c..3cce69675 100644
--- a/core/math/big/prime.odin
+++ b/core/math/big/prime.odin
@@ -8,6 +8,8 @@
This file contains prime finding operations.
*/
+
+
package math_big
import rnd "core:math/rand"
diff --git a/core/math/big/private.odin b/core/math/big/private.odin
index 9989a208a..419f2103f 100644
--- a/core/math/big/private.odin
+++ b/core/math/big/private.odin
@@ -15,6 +15,8 @@
These aren't exported for the same reasons.
*/
+
+
package math_big
import "core:intrinsics"
diff --git a/core/math/big/public.odin b/core/math/big/public.odin
index 2673a262f..3227d7bc4 100644
--- a/core/math/big/public.odin
+++ b/core/math/big/public.odin
@@ -8,6 +8,8 @@
This file contains basic arithmetic operations like `add`, `sub`, `mul`, `div`, ...
*/
+
+
package math_big
import "core:intrinsics"
diff --git a/core/math/big/radix.odin b/core/math/big/radix.odin
index 760c49d77..2b758dc35 100644
--- a/core/math/big/radix.odin
+++ b/core/math/big/radix.odin
@@ -12,6 +12,8 @@
- Use Barrett reduction for non-powers-of-two.
- Also look at extracting and splatting several digits at once.
*/
+
+
package math_big
import "core:intrinsics"
diff --git a/core/math/big/tune.odin b/core/math/big/tune.odin
index d67ff61b4..64a73b656 100644
--- a/core/math/big/tune.odin
+++ b/core/math/big/tune.odin
@@ -7,6 +7,8 @@
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
*/
+
+
package math_big
import "core:time"