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 rawFractionalSeconds property to GeneralizedTime #53

Merged
merged 4 commits into from
Jun 19, 2024

Commits on Jun 18, 2024

  1. Add rawFractionalSeconds property to GeneralizedTime

    Motivation:
    
    There is a possible overflow when computing a `Double` value for `fractionalSeconds` from an `ArraySlice` of bytes. Hence, access to this original `ArraySlice` is necessary.
    
    Modifications:
    
    - Add `rawFractionalSeconds` property to `GeneralizedTime`.
    - Add a new `internal init` to `GeneralizedTime` that accepts `rawFractionalSeconds` instead of `fractionalSeconds` and generates the later from the former.
    - Adjust the algorithm for computing `fractionalSeconds`, from a mathematical to a `String` computation. This is due to the precision mismatch between the mathematical computation and the native `Double` computation. This issue, which previously did not surface, now does, due to the newly included round-trip conversion from `fractionalSeconds` to `rawFractionalSeconds`.
    
    Result:
    
    - The `rawFractionalSeconds` property now provides the original `ArraySlice` from which `fractionalSeconds` was computed.
    - `GeneralizedTime` can now compute `fractionalSeconds` from the provided `rawFractionalSeconds`.
    clintonpi committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    13ba443 View commit details
    Browse the repository at this point in the history
  2. Implement minor fixes

    - Improve error and documentation.
    - Change the new `GeneralizedTime` `init` from `internal` to `public`.
    clintonpi committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    a518657 View commit details
    Browse the repository at this point in the history
  3. Fix formatting

    clintonpi committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    4ffe69f View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2024

  1. Configuration menu
    Copy the full SHA
    ea646ed View commit details
    Browse the repository at this point in the history