feat: config and approximate equality #19

Merged
glen merged 4 commits from config into main 2025-04-16 04:23:49 +00:00
Owner

Establishes a global config object for a TypeDispatcher instance, so far
with just properties representing comparison tolerances. Begins a
"relational" group of functions with basic approximate equality, and
an initial primitive ordering comparison. Ensures that methods that
depend on properties of config will be properly updated when those
properties change.

Establishes a global config object for a TypeDispatcher instance, so far with just properties representing comparison tolerances. Begins a "relational" group of functions with basic approximate equality, and an initial primitive ordering comparison. Ensures that methods that depend on properties of `config` will be properly updated when those properties change.
glen added 1 commit 2025-04-15 08:21:28 +00:00
feat: config and approximate equality
All checks were successful
/ test (pull_request) Successful in 17s
d3f2bc09b7
Establishes a global config object for a TypeDispatcher instance, so far
  with just properties representing comparison tolerances. Begins a
  "relational" group of functions with basic approximate equality, and
  an initial primitive ordering comparison. Ensures that methods that
  depend on properties of `config` will be properly updated when those
  properties change.
Author
Owner

To be ready for merge, this just needs additional generic relational methods the use the basic building blocks of absolute ordering and equality to give all of the usual comparison operations (per pocomath and/or mathjs).

To be ready for merge, this just needs additional generic relational methods the use the basic building blocks of absolute ordering and equality to give all of the usual comparison operations (per pocomath and/or mathjs).
glen added 1 commit 2025-04-15 23:36:42 +00:00
feat: more utility functions
All checks were successful
/ test (pull_request) Successful in 17s
686cd93927
Adds type constants zero and one, and allows you to obtain them
   directly from a type object. This facility creates a behavior
   with a parametric type: the type of `math.zero(T)` where `T` is a
   Type object (i.e., has type `TypeOfTypes`) depends not just on that
   type TypeOfTypes, but instead on the _value_ of the argument `T`. Since
   nanomath is not (yet?) equipped to handle typing such a method, we just
   set its return type to a new constant NotAType that (hopefully) does not
   work with the rest of the type system. Also allows you to compute `zero`
   and `one` from an example value, rather than from the type object itself.

   Adds utility function `isZero` to test if a value is zero.

   As usual so far, the additions uncovered some remaining bugs, which
   this PR fixes. For example, there was a problem in that resolution of
   the `one` method was failing because the `Any` pattern was blocking
   matching of the `TypeOfTypes` pattern. Although we may eventually need to
   sort the patterns for a given method to maintain a reasonable matching
   order, for now the solution was just to move the two patterns into the
   same source file and explicitly order them. (With the way onType and
   Implementations are currently implemented, the proper ordering is more
   general to more specific, i.e. later implementations supersede earlier
   ones.

   Adds many new tests, as always.
glen added 1 commit 2025-04-16 03:34:46 +00:00
feat: add nan to types, add hasnan and sign functions
All checks were successful
/ test (pull_request) Successful in 19s
c1791ddc20
Also makes certain to clean up the dependencies that are being
  generated even in case of throwing an error in the factory for
  a method.
glen added 1 commit 2025-04-16 04:04:40 +00:00
feat: add the rest of relational from pocomath
All checks were successful
/ test (pull_request) Successful in 18s
92ac7f38ae
glen changed title from WIP: feat: config and approximate equality to feat: config and approximate equality 2025-04-16 04:22:51 +00:00
Author
Owner

Now has all of the relational functions of pocomath (and maybe a bit more). Merging.

Now has all of the relational functions of pocomath (and maybe a bit more). Merging.
glen merged commit 70ce01d12b into main 2025-04-16 04:23:49 +00:00
glen deleted branch config 2025-04-16 04:23:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: StudioInfinity/nanomath#19
No description provided.