arrayfire / arrayfire-haskell

Haskell bindings to ArrayFire
http://hackage.haskell.org/package/arrayfire
BSD 3-Clause "New" or "Revised" License
59 stars 5 forks source link

Fix (**) and use property tests for Floating #57

Closed twesterhout closed 1 year ago

twesterhout commented 1 year ago

The default implementation of (**) relied on log and incorrectly handled some inputs. The fix is making an explicit implementation using the pow function.

To test the changes, tests for functions from the Floating typeclass are re-written using property tests. There are a few helper functions to make writing the actual properties easy.

More tests can be converted to properties, but this is left for another PR.

This PR is based on #56. I'll rebase on master once #56 is merged.

P.S. @dmjio I hope you don't mind the frequent PRs. I'm trying to use ArrayFire in a project and fixing/implementing stuff as I encounter problems.

twesterhout commented 1 year ago

This is now rebased on master with #56 merged.

dmjio commented 1 year ago

I hope you don't mind the frequent PRs. I'm trying to use ArrayFire in a project and fixing/implementing stuff as I encounter problems.

No this is very exciting, thank you for doing this.

More tests can be converted to properties, but this is left for another PR.

Awesome.