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

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

Open
tcNickolas opened this issue Jul 24, 2024 · 2 comments
Labels
good first issue Good for newcomers katas

Comments

@tcNickolas
Copy link
Contributor

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.

@tcNickolas tcNickolas added good first issue Good for newcomers katas labels Jul 24, 2024
@devikamehra
Copy link
Contributor

@tcNickolas I would like to work on this

@tcNickolas
Copy link
Contributor Author

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

github-merge-queue bot pushed a commit that referenced this issue Aug 28, 2024
Added DoubleAsStringWithPrecision function in Complex Arithmetics Kata

This is to address the issue #1788
github-merge-queue bot pushed a commit that referenced this issue Aug 29, 2024
Added DoubleAsStringWithPrecision function to Single Qubit Gate Kata

This is to address the issue #1788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers katas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants