mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Package lines for core:math and more.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
// package log implements the context.Logger interface.
|
||||||
package log
|
package log
|
||||||
|
|
||||||
import "base:runtime"
|
import "base:runtime"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -5,8 +7,6 @@
|
|||||||
This file collects public proc maps and their aliases.
|
This file collects public proc maps and their aliases.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
=== === === === === === === === === === === === === === === === === === === === === === === ===
|
=== === === === === === === === === === === === === === === === === === === === === === === ===
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
// package big implements arbitrary precision integers and rationals.
|
||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A BigInt implementation in Odin.
|
|
||||||
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
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.
|
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
||||||
*/
|
*/
|
||||||
package math_big
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
import "base:runtime"
|
import "base:runtime"
|
||||||
import rnd "core:math/rand"
|
import rnd "core:math/rand"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -25,8 +27,6 @@
|
|||||||
TODO: Handle +/- Infinity and NaN.
|
TODO: Handle +/- Infinity and NaN.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
import "base:builtin"
|
import "base:builtin"
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -9,9 +11,6 @@
|
|||||||
This file contains logical operations like `and`, `or` and `xor`.
|
This file contains logical operations like `and`, `or` and `xor`.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The `and`, `or` and `xor` binops differ in two lines only.
|
The `and`, `or` and `xor` binops differ in two lines only.
|
||||||
We could handle those with a switch, but that adds overhead.
|
We could handle those with a switch, but that adds overhead.
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -9,9 +11,6 @@
|
|||||||
This file contains prime finding operations.
|
This file contains prime finding operations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Determines if an Integer is divisible by one of the _PRIME_TABLE primes.
|
Determines if an Integer is divisible by one of the _PRIME_TABLE primes.
|
||||||
Returns true if it is, false if not.
|
Returns true if it is, false if not.
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -16,9 +18,6 @@
|
|||||||
These aren't exported for the same reasons.
|
These aren't exported for the same reasons.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -9,9 +11,6 @@
|
|||||||
This file contains basic arithmetic operations like `add`, `sub`, `mul`, `div`, ...
|
This file contains basic arithmetic operations like `add`, `sub`, `mul`, `div`, ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -13,9 +15,6 @@
|
|||||||
- Also look at extracting and splatting several digits at once.
|
- Also look at extracting and splatting several digits at once.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
import "core:os"
|
import "core:os"
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#+build ignore
|
||||||
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
@@ -7,9 +10,6 @@
|
|||||||
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#+build ignore
|
|
||||||
package math_big
|
|
||||||
|
|
||||||
import "core:time"
|
import "core:time"
|
||||||
import "base:runtime"
|
import "base:runtime"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// package bits implements bit-level operations, including the ability to set or toggle individual bits in an integer.
|
||||||
package math_bits
|
package math_bits
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// package cmplx implements trigonometric and other mathematic operations on complex numbers.
|
||||||
package math_cmplx
|
package math_cmplx
|
||||||
|
|
||||||
import "base:builtin"
|
import "base:builtin"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// easing procedures and flux easing used for animations
|
// package ease implements easing procedures and flux easing used for animations.
|
||||||
package ease
|
package ease
|
||||||
|
|
||||||
import "core:math"
|
import "core:math"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// package fixed implements fixed-point rational numbers and conversion to/from `f64`.
|
||||||
package math_fixed
|
package math_fixed
|
||||||
|
|
||||||
import "core:math"
|
import "core:math"
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// core:math/linalg implements linear algebra procedures useful for 3D spatial transformations
|
// package linalg implements linear algebra procedures useful for 3D spatial transformations.
|
||||||
package linalg
|
package linalg
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// core:math/linalg/glsl implements a GLSL-like mathematics library plus numerous other utility procedures
|
// package glsl implements a GLSL-like mathematics library plus numerous other utility procedures.
|
||||||
package math_linalg_glsl
|
package math_linalg_glsl
|
||||||
|
|
||||||
import "base:builtin"
|
import "base:builtin"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// core:math/linalg/hlsl implements a HLSL-like mathematics library plus numerous other utility procedures
|
// package hlsl implements a HLSL-like mathematics library plus numerous other utility procedures.
|
||||||
package math_linalg_hlsl
|
package math_linalg_hlsl
|
||||||
|
|
||||||
import "base:builtin"
|
import "base:builtin"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// package math implements typical trignometric and other basic math routines.
|
||||||
package math
|
package math
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
|
#+private
|
||||||
|
package math_noise
|
||||||
|
|
||||||
/*
|
/*
|
||||||
OpenSimplex2 noise implementation.
|
OpenSimplex2 noise implementation.
|
||||||
|
|
||||||
Ported from https://github.com/KdotJPG/OpenSimplex2.
|
Ported from https://github.com/KdotJPG/OpenSimplex2.
|
||||||
Copyright 2022 Yuki2 (https://github.com/NoahR02)
|
Copyright 2022 Yuki2 (https://github.com/NoahR02)
|
||||||
*/
|
*/
|
||||||
#+private
|
|
||||||
package math_noise
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Private implementation details follow.
|
Private implementation details follow.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
OpenSimplex2 noise implementation.
|
package noise implements the OpenSimplex2 noise algorithm.
|
||||||
|
|
||||||
Ported from [[ https://github.com/KdotJPG/OpenSimplex2 }].
|
Ported from [[ https://github.com/KdotJPG/OpenSimplex2 }].
|
||||||
Copyright 2022 Yuki2 [[ https://github.com/NoahR02 ]]
|
Copyright 2022 Yuki2 [[ https://github.com/NoahR02 ]]
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
|
// package rand implements various random number generators.
|
||||||
/*
|
|
||||||
Package core:math/rand implements various random number generators
|
|
||||||
*/
|
|
||||||
package rand
|
package rand
|
||||||
|
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
|
|||||||
Reference in New Issue
Block a user