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 M.Q.Convert.DoubleAsStringWithFormat #1406

Open
tcNickolas opened this issue Apr 19, 2024 · 1 comment
Open

Add M.Q.Convert.DoubleAsStringWithFormat #1406

tcNickolas opened this issue Apr 19, 2024 · 1 comment
Labels
enhancement New feature or request needs triage

Comments

@tcNickolas
Copy link
Member

Is your feature request related to a problem? Please describe.
I print arbitrary floating-point numbers that are arguments to the tests in the katas quite often, and printing them with the default ~15 digits of precision doesn't look particularly good, especially if there are multiple numbers and a narrow space to display the text. Here is the example from the published Single-Qubit Gates kata, task "Prepare Arbitrary State":

image

Describe the solution you'd like
Bring back the function M.Q.Convert.DoubleAsStringWithFormat that used to be available in the classic QDK.

Describe alternatives you've considered
I could modify some of the tests to use "neat" numbers, but that makes the code much more complicated unnecessarily, and sometimes I need specific numbers that I cannot round to 3-4 digits of precision.

@tcNickolas tcNickolas added enhancement New feature or request needs triage labels Apr 19, 2024
@filipw
Copy link
Contributor

filipw commented Apr 22, 2024

I also ran into this problem.

I think in general it would be good to get some guidance on how display formatting of numerical values is supposed to be done in the new QDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

2 participants