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

Miscellaneous 0.8.0 stuff #51

Closed
oscbyspro opened this issue Jul 27, 2024 · 3 comments
Closed

Miscellaneous 0.8.0 stuff #51

oscbyspro opened this issue Jul 27, 2024 · 3 comments
Labels
addition oh, so shiny! brrr such code, much wow subtraction huh? where did it go?

Comments

@oscbyspro
Copy link
Owner

I'll use this thread to document various minor changes.

@oscbyspro oscbyspro added this to the Ultimathnum 0.8.0 milestone Jul 27, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Jul 28, 2024

Lots of fuzzing. It's nice. Haven't found any bugs yet.

@oscbyspro oscbyspro added brrr such code, much wow addition oh, so shiny! subtraction huh? where did it go? labels Jul 28, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Jul 31, 2024

  • I'll replace plus (_: Bool) and incremented() with incremented(_: Bool).
  • l'll replace minus(_: Bool) and decremented() with decremented(_: Bool).

oscbyspro added a commit that referenced this issue Aug 1, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Aug 5, 2024

I'll add BinaryInteger/isPositive because arbitrary integers can do better than x > 0.

extension BinaryInteger {

    /// Indicates whether this value is greater than zero.
    ///
    /// - Note: Big integers evaluate it in place, cf. `compared(to: 0)`.
    ///
    @inlinable public var isPositive: Bool {
        if !Self.isArbitrary {
            return self > Self.zero
            
        }   else if Bool(self.appendix) {
            return !Self.isSigned
            
        }   else {
            return self.withUnsafeBinaryIntegerBody {
                !$0.isZero
            }
        }
    }
}

Note

Req. arbitrary integer normalization (#26) might be useful here too.

oscbyspro added a commit that referenced this issue Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny! brrr such code, much wow subtraction huh? where did it go?
Projects
None yet
Development

No branches or pull requests

1 participant