-
Notifications
You must be signed in to change notification settings - Fork 202
Improve guidance for integer and floating-point numbers #398
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
Conversation
This list is currently missing 128-bit numbers, and we could get more integer types in the future. There's no reason to duplicate all of them here -- it will just get out of date again, and isn't needed as part of introducing the integer type.
- Per TR, correct the framing of floating-point as having a margin of error in the result of calculations, not as themselves being inexact. - Match the flow from the integer section, first introducing the floating-point types and then describing them (and contrasting their behavior to integer math). - Show an example of the change in value spacing (ulp) between large/small floating-point numbers. Co-authored-by: Steve Canon <scanon@apple.com>
amartini51
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stephentyrone for the corrections! Incorporated your feedback and re-ordered some prose to make it flow better.
Another piece of context I don't think I mentioned. I'm trying to give developers enough information about what makes floating-point math different that they can make an informed decision — so they can avoid the tripping hazard of assuming every number that includes a decimal point should be a Double. But also trying to scare folks away from using "weird floating-point math" when that actually is the right data type.
Co-authored-by: Steve Canon <scanon@apple.com>
colleenish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass edits. Let me know if you have any questions.
Edits from <rdar://162699805> Co-authored-by: Colleen Toporek <colleen_toporek@apple.com>
colleenish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second pass. One follow-up fix.
colleenish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good; no additional changes from me.
aa04a2b to
0f4377d
Compare
Summary of changes:
Fixes: rdar://122436757