set operations#756
Conversation
|
Thanks for your new PR @Nekomajin42 , it looks neat. I will review it this week (it's quite a large PR). |
|
Nice work Tóth, thanks again. Your code is very well readable, nice job. I have two comments:
|
|
I will do that. Btw, my first name is Róbert. :) |
|
Ah, sorry Róbert! Thanks, looking forward to the updates. |
|
Hi Jos! I am working on the changes you've asked. It seems to work for fractions and bignumbers, but if I have a complex number in an array, and try to create its union with another array, I get the following error: Any idea? EDIT: |
|
It's indeed not possible to order complex numbers since they have no ordering defined. You can compare whether two complex numbers are equal or not, but not if one is larger than the other. The only way to solve this is to have the set functions not rely on sorted arrays but only use equal checks. Would that be possible? |
|
I think it will be easy. I wanted to output a sorted result, but it is not necessary. I will give it a try. |
|
👍 |
|
I guess I should use |
|
I don't know what error you get, so I'm not sure, but it's probably because the utils functions only contain low level JS stuff (working with plain numbers, objects, arrays). They don't have access to the context of math.js with these high level functions like To solve this you should move your function factory (type, config, load, typed) {
var equal = load(require('../relational/equal'));
// ...
return function identify (...) {
// ...
}
}
// we don't export exports.name because we don't want to expose
// the identify function in `math`
exports.factory = factory; |
|
Well, I left the |
|
Using that may be the exact behavior we want, what do you think? I will await your PR and give pay some extra extension to this. |
|
I think you are correct. I will try to send the pr this week to finish this issue finally. |
|
@Nekomajin42 we can close this PR too right? |
Hey Jos!
It should work now. Can you delete my previous #703 pr?