Open Patashu opened 2 years ago
Current issues:
{ m: Number.POSITIVE_INFINITY, e: 0 }
). BreakInfinity.cs already does that.eq_tolerance
is not good with small values. For example, new Decimal(0).eq_tolerance(5.323e-47, 1e-10)
: expected true
, actual false
sinh
and tanh
. E.g. try tanh
with 7.23e222 or check test-report.html
after running the tests for more examplesnew Decimal(1).divide(0)
:kekw:new Decimal(0).pow(1)
and Math.pow(0, 1)
Decimal.cmp
has unreachable code which is actually reachable when you toss in some value combinations. For example 0
, NaN
Decimal.cmp
produces incorrect values for non-zero value and NaN, try 1
and NaN
@Patashu I need your thoughts about what to do with these I've also merged tests branch into master, so run tests from there
Would like to pick up some of these? I'm going to fix the infinity one at least
next time I'm in the mood to code I'll do whatever you haven't done yet (optimistically it'll be sometime this week)
Good news: most of the broken tests were non-finite-values-related *proceeds with fixing infinity on master*
I would suggest grabbing hyperbolic functions since I have no idea how they work %) I'll probably do something with the rounding issue
I got them from slabdrill iirc lol
but I can figure out a good replacement
7:08 AM] Razenpok: Hey, Pata I've ported Number-compatibility tests from C# version to check if Decimal operations produce same values as Number operations. You can check them on
tests
branch by runningnpm ci
and thennpm run test
[7:08 AM] Razenpok: It will run for a bit (takes several seconds on my PC) 7:08 AM] Razenpok: And there are a lot of test cases because combinatorial explosion [7:09 AM] Razenpok: You can check all the source in tests folder [7:09 AM] Razenpok: Currently, I observe a lot of "Unreachable code" errors and I'm not sure what to do with them [7:09 AM] Razenpok: Either to disable these test cases or fix the bugs