Skip to content

Use M.Q.Convert.DoubleAsStringWithPrecision to trim Doubles printed in the katas #1788

Open

Description

Follow-up to #1406: now that the function M.Q.Convert.DoubleAsStringWithPrecision is available, we can use it in the katas to shorten the long floating-point numbers.

Here are a few examples of the katas that print long doubles:

  • Complex Arithmetic
    image
  • Single-Qubit Gates kata, task "Prepare Arbitrary State"
  • Preparing Quantum States, task "Unequal Superposition"

There are probably others; the typical scenario in which this occurs is printing the Double parameters of the test or returns of the solution for an incorrect solution. We are unlikely to need more than 2-3 digits of precision in these cases.

Activity

  1. devikamehra commented on Aug 23, 2024

    @devikamehra
    Contributor

    Mariia Mykhailova (@tcNickolas) I would like to work on this

  2. tcNickolas commented on Aug 23, 2024

    @tcNickolas
    ContributorAuthor

    Devika Mehra (@devikamehra) Sounds great! It should be very straightforward, but let us know if you have any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuekatas

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions