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

Change the overflow behavior of floating-point inits from String #25313

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@stephentyrone
Copy link
Member

commented Jun 8, 2019

All other floating-point inits round out-of-range inputs to the nearest representable value. The conversions from string currently do not match this behavior, and return nil instead. This change makes it so only invalid character sequences produce nil; with overflow producing infinity and underflow producing zero, matching the behavior of literals.

Fixes rdar://problem/36990878

Change the overflow behavior of floating-point inits from String
All other floating-point inits round out-of-range inputs to the nearest representable value. The conversions from string currently do not match this behavior, and return nil instead. This change makes it so only invalid character sequences produce nil; with overflow producing infinity and underflow producing zero, matching the behavior of literals.

@stephentyrone stephentyrone requested a review from airspeedswift Jun 8, 2019

@stephentyrone

This comment has been minimized.

Copy link
Member Author

commented Jun 8, 2019

@swift-ci please test

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

Build failed
Swift Test Linux Platform
Git Sha - d72f61d

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

Build failed
Swift Test OS X Platform
Git Sha - d72f61d

@stephentyrone

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

@swift-ci please test

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

Build failed
Swift Test Linux Platform
Git Sha - d72f61d

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

Build failed
Swift Test OS X Platform
Git Sha - d72f61d

@stephentyrone

This comment has been minimized.

Copy link
Member Author

commented Jun 13, 2019

@swift-ci please test

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Build failed
Swift Test Linux Platform
Git Sha - d72f61d

@stephentyrone

This comment has been minimized.

Copy link
Member Author

commented Jul 1, 2019

@swift-ci please test linux

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

Build failed
Swift Test Linux Platform
Git Sha - d72f61d

@palimondo

This comment has been minimized.

Copy link
Collaborator

commented Jul 2, 2019

@swift-ci please test linux platform

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

Build failed
Swift Test Linux Platform
Git Sha - d72f61d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.