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

Added DoubleAsStringWithPrecision function - Linear Algebra #1891

Conversation

devikamehra
Copy link
Contributor

Added DoubleAsStringWithPrecision function to Linear Algebra

This is to resolve #1788

Copy link
Contributor

@tcNickolas tcNickolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need to improve the display of Doubles in this particular kata... The tasks deal with exactly one test case each, and the matrices they work with are carefully hand-picked to have very nice floating-point values in them, with at most one decimal point. I don't think the learner is likely to try and return values with a lot of decimal points either, since most operations involve only simple things like swapping numbers around and addition/subtraction, not a lot of division going on here. This means that enforcing precision 3 would actually make the displayed numbers longer with just extra trailing zeros

@devikamehra
Copy link
Contributor Author

I'm not sure we need to improve the display of Doubles in this particular kata... The tasks deal with exactly one test case each, and the matrices they work with are carefully hand-picked to have very nice floating-point values in them, with at most one decimal point. I don't think the learner is likely to try and return values with a lot of decimal points either, since most operations involve only simple things like swapping numbers around and addition/subtraction, not a lot of division going on here. This means that enforcing precision 3 would actually make the displayed numbers longer with just extra trailing zeros

So, should I reduce the precision to 1 or remove this altogether?

@tcNickolas
Copy link
Contributor

Precision 1 is the default display of doubles with 0 or 1 decimal points, so I don't think we need to change anything in this kata

@devikamehra
Copy link
Contributor Author

Not required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use M.Q.Convert.DoubleAsStringWithPrecision to trim Doubles printed in the katas
2 participants