chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.76k stars 414 forks source link

BigInteger <=> operator #17690

Open lydia-duncan opened 3 years ago

lydia-duncan commented 3 years ago

The <=> implementation doesn't call the GMP swap function, it instead calls the set function (with some explicit behavior if the two values are on different locales). Should it call the GMP swap function?

The swap method calls the GMP swap function and the rest of the operator definitions rely on the underlying GMP functions that correspond with their functionality.

lydia-duncan commented 3 years ago

I think it should.

Michael says:

I think it should when the two GMP numbers are on the same locale

bradcray commented 3 years ago

This one also doesn't feel like library stabilization? (assuming the observed behavior is similar in either approach?)

lydia-duncan commented 3 years ago

My hope is that this purely has performance impacts, but I'm not certain. It seems like it would be a bug in GMP if it didn't so it is probably not a library stabilization issue?