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 DoubleToStringConverter::ToShortestString overload set #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

N-Dekker
Copy link
Contributor

Allowed users to write generic code more easily, in cases where the input value is either a double, or a single-precision float.

Included a unit test, TEST(DoubleToShortestString).

Complementary to pull request #158 commit eee1a45 "Add StringToDoubleConverter::StringTo<T> member function templates"

@N-Dekker
Copy link
Contributor Author

N-Dekker commented Apr 11, 2021

FYI, This overload set would allow cleaning up and simplifying user code like this: https://github.com/InsightSoftwareConsortium/ITK/blob/v5.2.0/Modules/Core/Common/src/itkNumberToString.cxx#L26-L41

Update (13 April 2021): Such a user code cleanup and simplification could be as follows (if this pull request gets accepted): N-Dekker/ITK@3098b88

@N-Dekker N-Dekker force-pushed the DoubleToStringConverter-ToShortestString-overloads branch from a60aae6 to 4074174 Compare April 11, 2021 11:39
@N-Dekker N-Dekker marked this pull request as ready for review April 11, 2021 11:40
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Apr 13, 2021
Simplified ITK's `FloatingPointNumberToString` implementation by using `DoubleToStringConverter::ToShortestString` overload set, proposed by pull request google/double-conversion#159

Related to issue google/double-conversion#160 "Add generic (template) methods for to_string (float or double)", opened by Florian Loitsch (floitsch).
Allowed users to write generic code more easily, in cases where the input value is either a double, or a single-precision float.

Included a unit test, `TEST(DoubleToShortestString)`.

Complementary to pull request google#158 commit eee1a45 "Add `StringToDoubleConverter::StringTo<T>` member function templates"
@N-Dekker N-Dekker force-pushed the DoubleToStringConverter-ToShortestString-overloads branch from 4074174 to 270fccb Compare August 16, 2022 09:21
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.

1 participant