Math epic - Part 1#763
Conversation
f16d26f to
7fcb947
Compare
Resolves the following thread(s): - jank-lang#763 (comment).
Resolves the following thread(s): - jank-lang#763 (comment).
Resolves the following thread(s): - jank-lang#763 (comment).
Resolves the following thread(s): - jank-lang#763 (comment).
c7eb4a7 to
a94fcf5
Compare
Resolves the following thread(s): - jank-lang#763 (comment).
Resolves the following thread(s): - jank-lang#763 (comment).
a94fcf5 to
1ee6961
Compare
Resolves the following thread(s): - jank-lang#763 (comment).
Resolves the following thread(s): - jank-lang#763 (comment).
Resolves the following thread(s): - jank-lang#763 (comment).
Resolves the following thread(s): - jank-lang#763 (comment).
d31177b to
254ec28
Compare
|
|
||
| bool real::equal(object const &o) const | ||
| { | ||
| if(is_nan(this) || is_nan(&o)) |
There was a problem hiding this comment.
This is UB, since we need detail::untagged for raw pointers, due to the recent NaN boxing changes. Please read the big comment block in oref.hpp for details.
We need it for both this and &o. Most likely, this will just crash right now.
Also, we shouldn't use is_nan for this, since that would require building an object_ref, visiting that, and then actually checking isnan. Since we have data already, let's just check directly. Arithmetic operations are one of the most important parts in the jank runtime to keep fast, so keep that in mind. That also means we could use isnan and avoid a duplicate visit on o if we do it later in the fn.
There was a problem hiding this comment.
On second thought, why is this not working by default?
Requires a Clojure test suite repoint (jank-lang/clojure-test-suite#875). Done.Brings us to 125 of 231 tests. Goal is to get to 145, covering all "math"
clojure.corefunctions with tests in the test suite.