-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Doc: clarifying irrational #38057
Doc: clarifying irrational #38057
Conversation
Clarifying (fixing?) JuliaLang#37977 [skip ci]
Any specific reason not to format |
Not really, I just overlooked that, actually copied from your fixed text (where Float64 wasn't like that, and still the extra word) but then changed to the pi symbol. It's now fixed, and I'm ok with this merged as is, if you/others are. |
[skip ci]
arithmetic operations with other numeric quantities. | ||
Number type representing an exact irrational value, which is automatically rounded to the "correct" precision in | ||
arithmetic operations with other numeric quantities. Even the simplest calculations, such as `-pi` or `2π` convert a | ||
number to `Float64`, making the result no longer irrational. |
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.
Maybe rephrase:
Calculations involving arithmetic between numeric types and irrational types will lead to conversion to a numeric type. For example, -pi or 2π produce Float64
results.
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.
I would like to note that -pi
is unary, and thus not an arithmetic operation between a numeric type and irrational.
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.
Maybe remove it then?
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.
I was just going to change, but I have second thoughts about "Calculations involving arithmetic" (as synonyms?) and "between numeric types". With pi a number, this could be misunderstood, so I was thinking Number
types, but I see it has misleading help "Abstract supertype for all number types".
Also should clarification rather go into Irrational and/or AbstractIrrational?
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.
"-pi is unary, and thus not an arithmetic operation", mathematically not an operation? But in Julia, it's a unary operator as in almost all languages, and involves calculation:
-(x::AbstractIrrational) = -Float64(x)
Clarifying (fixing?) #37977
[skip ci]