Skip to content

Conversation

@josephcsible
Copy link

@josephcsible josephcsible commented Dec 19, 2019

abs x * signum x is supposed to be the same as x. Make this the case, as well as making abs work as you'd expect for fractions in math.

Turn Naturals into Integers before trying to multiply them by other Integers, and don't call a non-existent numerator function.

`abs x * signum x` is supposed to be the same as `x`. Make this the case, as well as making `abs` work as you'd expect for fractions in math.
@josephcsible
Copy link
Author

Wait a minute, the rest of the instance doesn't work either... There is no numerator, and you can't multiply Integers with Naturals. I'll fix that too.

Turn `Natural`s into `Integer`s before trying to multiply them by other `Integer`s, and don't call a non-existent `numerator` function.
@josephcsible josephcsible changed the title Fix abs in the Num instance of Frac Fix the Num instance of Frac Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant