-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pairing product with a null element is always null #7
Comments
Thanks, and sorry it's taken so long for me to respond. I think you're right but I'm afraid I wrote that code a long time ago, and -Ben On Sun, Sep 4, 2016 at 9:40 AM, Rémi Bazin [email protected] wrote:
|
Hello,
I believe that there is a bad behavior implemented in the function
element_prod_pairing
, quoted below:The first loop is looking for null elements and exits with a null (unity) result if it finds any.
If the function is to be what it states - a product of pairings - it should just ignore couples with a null element, but not disregard the rest of the input and return a null result.
The following snippet shows that the behavior is indeed not the same as what the manual product would produce:
The couples containing a null element should therefore only be removed from the list before the pairing product is computed.
Best regards,
Rémi
PS : Is there a better way to put already existing variables in a 'element_t[]' array other than copying them? I've tried to only copy their pointer value, but without success (I am not used to manipulating fixed-sized arrays). Thank you for your advice.
The text was updated successfully, but these errors were encountered: