Skip to content

[release/6.0] Generic Math Preview - Use correct NumberStyle when parsing double and float - #59349

Merged
Anipik merged 3 commits into
release/6.0from
backport/pr-59205-to-release/6.0
Sep 21, 2021
Merged

[release/6.0] Generic Math Preview - Use correct NumberStyle when parsing double and float#59349
Anipik merged 3 commits into
release/6.0from
backport/pr-59205-to-release/6.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Sep 20, 2021

Copy link
Copy Markdown
Contributor

Backport of #59205 to release/6.0

/cc @tannergooding@7rakir

Customer Impact

Customers using the new generic math preview feature will not be able to use IParseable<float>, IParseable<double> or IParseable<Half> and have it work for anything except strings containing integers.

They would need to fallback to the parse methods exposed by INumber<T> that take a NumberStyles instead.

Testing

Additional tests were duplicated and updated to explicitly cover the generic math scenario.

Risk

Low. This is a small fix for a preview API that requires explicit opt-in to consume.

Richard Sefrand others added 3 commits September 20, 2021 15:38
IParseable<float> and IParseable<double> would fail when parsing
a decimal point number due to incorrect NumberStyles parameter.
E.g. IParseable<double>.TryParse would fail as opposed to
IParseable<double>.Parse because the former explicitly states to use
NumberStyles.Integer
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #59205 to release/6.0

/cc @tannergooding@7rakir

Customer Impact

Testing

Risk

Author:github-actions[bot]
Assignees:-
Labels:

area-System.Numerics

Milestone:-

@tannergoodingtannergooding added the Servicing-consider Issue for next servicing release review label Sep 20, 2021
@tannergooding

Copy link
Copy Markdown
Member

CC. @jeffhandley, @danmoseley

@danmoseley

Copy link
Copy Markdown
Contributor

LGTM. feel free to send mail to Steve/tactics. The key point being it's only the preview methods affected (I would have snipped out the diff for the non preview methods even though it's a no-op, but it's not important.)

@tannergoodingtannergooding changed the title [release/6.0] Use correct NumberStyle when parsing double and float[release/6.0] Generic Math Preview - Use correct NumberStyle when parsing double and floatSep 20, 2021
@danmoseleydanmoseley added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 21, 2021
@danmoseley

Copy link
Copy Markdown
Contributor

was approved offline

@Anipik

Copy link
Copy Markdown
Contributor

cc @tannergooding@pgovind can you add a CR here ?

@danmoseley

Copy link
Copy Markdown
Contributor

reviewed

@Anipik
Anipik merged commit 036cb86 into release/6.0Sep 21, 2021
@jkotas
jkotas deleted the backport/pr-59205-to-release/6.0 branch September 24, 2021 04:30
@ghostghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.NumericsServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@tannergooding@danmoseley@Anipik