[cfp-interest 3750] Minus signs and hyphens
Jim Thomas
jaswthomas at sbcglobal.net
Sat Jan 3 09:47:03 PST 2026
Use of minus signs vs hyphens has been a continuing issue in math and floating-point specification in C documents. This note is based on off line discussion about this issue in the Annex F Special Cases proposal. In the current version of the proposal linked from https://wiki.edg.com/pub/CFP/WebHome/C2Y-F-SpecialCases-20251030.pdf, the cases mentioned in this note are correct (per comments below). This note is just to document off line discussion. C references are to N3685.
The basic idea is to use minus signs for value negation and to use hyphens for the C unary - and subtraction operators. The minus sign is a mathematical symbol, the hyphen is a C language element.
The purpose of the first bullet -0- for atan2 is to state an equivalence property of the C atan2 function, not an equivalence of C expressions per se. We’re saying an evaluation of the C expression composing the unary - operator and the C atan2 function is equivalent, WRT result value and side effects, to the evaluation of the C atan2 function but with the value of the first argument negated.
The unary - operator is properly represented by a hyphen. Use of a minus sign (value negation) would indicate that the statement to be just about values.
The value negation for the first argument is properly represented by a minus sign.
Similarly for atan2pi.
- Jim Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20260103/7e9e5bec/attachment.htm>
More information about the cfp-interest
mailing list