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

Add big.Rational type to std #2102

Merged
merged 7 commits into from
Apr 11, 2019
Merged

Add big.Rational type to std #2102

merged 7 commits into from
Apr 11, 2019

Commits on Apr 11, 2019

  1. Add read-only, non-allocating Int for internal constants

    A constant Int is one which has a value of null for its allocator field.
    It cannot be resized or have its limbs written. Any attempt made to
    write to it will be caught with a runtime panic.
    tiehuis committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    ea1d2a2 View commit details
    Browse the repository at this point in the history
  2. Add initial big.Rational type

    tiehuis committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    5f4fcd5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3ecdfd View commit details
    Browse the repository at this point in the history
  4. Small fixes for big.Rational and corrections for gcdLehmer

    The int div code still causes some edge cases to fail right now.
    tiehuis committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    d3e1f32 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    30788a9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    87d8ecd View commit details
    Browse the repository at this point in the history
  7. Pack big.Int sign and length fields

    This effectively takes one-bit from the length field and uses it as the
    sign bit. It reduces the size of an Int from 40 bits to 32 bits on a
    64-bit arch.
    
    This also reduces std.Rational from 80 bits to 64 bits.
    tiehuis committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    78af62a View commit details
    Browse the repository at this point in the history