microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
446 stars 90 forks source link

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

Open tcNickolas opened 3 months ago

tcNickolas commented 3 months ago

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:

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.

devikamehra commented 2 months ago

@tcNickolas I would like to work on this

tcNickolas commented 2 months ago

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