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

Update NSScanner to use BinaryFloatingPoint #631

Merged
merged 3 commits into from Sep 13, 2016

Conversation

Projects
None yet
2 participants
@xwu
Collaborator

xwu commented Sep 13, 2016

Migrate from internal _FloatLike protocol to BinaryFloatingPoint.

Incidentally fix a subtle bug and align to Darwin Foundation:

  • We don't want to return FLT_MIN when the string has a negative number with magnitude too great to be representable in a Float (FLT_MIN isn't like Int.min!)
  • Actually, we don't even want -Float.greatestFiniteMagnitude, since Darwin Foundation returns -Float.infinity

I've adjusted the behavior accordingly and written a test.

Annoyingly, one test is currently failing on my machine, but it fails both with and without this patch and must be unrelated (i.e., it is failing with a freshly checked-out copy of swift-corelibs-foundation on XCode 8 GM):

error: TestNSData.test_replaceBytes : XCTAssertEqual failed: ("<0008090a 00>") is not equal to ("<0008090a 00>")

@xwu xwu referenced this pull request Sep 13, 2016

Merged

Port of Foundation to Android #622

@parkera

This comment has been minimized.

Member

parkera commented Sep 13, 2016

Thanks @xwu!

@parkera

This comment has been minimized.

Member

parkera commented Sep 13, 2016

@swift-ci please test

@parkera parkera merged commit 0626a97 into apple:master Sep 13, 2016

1 check passed

Swift Test Linux Platform Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment