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

[core] Add numeric.NegLong #18

Closed
kevin-lee opened this issue Apr 29, 2023 · 0 comments · Fixed by #22
Closed

[core] Add numeric.NegLong #18

kevin-lee opened this issue Apr 29, 2023 · 0 comments · Fixed by #22
Assignees
Labels
Milestone

Comments

@kevin-lee
Copy link
Owner

Summary

[core] Add numeric.NegLong

Version

unreleased

Description

NegLong(-1L) // compiles
NegLong(0L)  // compile-time error
NegLong(1L)  // compile-time error

NegLong.from(-123L)
// Either[String, NegLong] = Right(NegLong(-123L))

NegLong.from(123L)
// Either[String, NegLong] = Left("Invalid value: 123L. It must be a negative Long")

NegLong.unsafeFrom(-999L)
// NegLong = NegLong(-999L)

NegLong.unsafeFrom(999L)
// IllegalArgumentException(Invalid value: 999L. It must be a negative Long) is thrown
@kevin-lee kevin-lee added the task label Apr 29, 2023
@kevin-lee kevin-lee added this to the m1 milestone Apr 29, 2023
@kevin-lee kevin-lee self-assigned this Apr 29, 2023
@kevin-lee kevin-lee changed the title [core] Add numeric.NegLong [core] Add numeric.NegLong Apr 29, 2023
kevin-lee added a commit that referenced this issue Apr 29, 2023
kevin-lee added a commit that referenced this issue Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant