Skip to content
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

Uint.LTE() Bug #5395

Closed
4 tasks
jpthor opened this issue Dec 12, 2019 · 1 comment · Fixed by #5399
Closed
4 tasks

Uint.LTE() Bug #5395

jpthor opened this issue Dec 12, 2019 · 1 comment · Fixed by #5399

Comments

@jpthor
Copy link
Contributor

jpthor commented Dec 12, 2019

Summary of Bug

Unsigned Integer Less-Than-Equal incorrectly evaluates when comparing equal numbers. Uint.LTE()

Current

// LTE returns true if first Uint is lesser than or equal to the second
func (u Uint) LTE(u2 Uint) bool { return !u.GTE(u2) }

Fix

func (u Uint) LTE(u2 Uint) bool { return !u.GT(u2) }

Version

Latest Version

Steps to Reproduce

small := NewUint(10)
large := NewUint(10)
fmt.Println(small.LTE(large))
// Should evaluate TRUE

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

It's been a long time, old pal, since I've seen a bug in coins/int/unit.

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 a pull request may close this issue.

2 participants