Submitter:CFP group
Submission Date: 2021-01-24
Document: WG14 N2643
Title: N2643: negative
Reference Documents: N2596

Summary: The term 'negative' is ambiguous when talking about zero.

Is -0.0 negative? Is it nonnegative? Is +0.0 positive? We believe that:

• negative is less than zero
• positive is greater than zero
• -0.0 and +0.0 are neither negative nor positive values
• -0.0 has a negative sign
• +0.0 has a positive sign

However, -0.0 and +0.0 are both nonnegative and nonpositive.

Since C23 now requires just twos complement integers, there are no -0 integers (unlike with sign-magnitude and ones complement).

Since some people interpret 'negative' to include -0.0, we believe that the following changes would make the standard clearer.

• In 7.12.6.11 The log functions, change
A domain error occurs if the argument is negative.
to
A domain error occurs if the argument is negativeless than zero.
• In 7.12.6.12 The log10 functions, change
A domain error occurs if the argument is negative.
to
A domain error occurs if the argument is negativeless than zero.
• In 7.12.7.5 The pow functions, change
A domain error occurs if x is finite and negative and y is finite and not an integer value.
to
A domain error occurs if x is finite and negativeless than zero and y is finite and not an integer value.
• In 7.12.8.4 The tgamma functions, change
A range error occurs for some negative finite x
to
A range error occurs for some negative finite x less than zero
• In 7.21.6.1 The fprintf function, '+' flag, change:
(It begins with a sign only when a negative value is converted if this flag is not specified.)300)
to
(It begins with a sign only when a negative value with a negative sign is converted if this flag is not specified.)300)

Since footnote 300

300) The results of all floating conversions of a negative zero, and of negative values that round to zero, include a minus sign.

is not normative, we believe that the above change is needed.

• In 7.29.2.1 The fwprintf function, '+' flag, change:
(It begins with a sign only when a negative value is converted if this flag is not specified.)356)
to
(It begins with a sign only when a negative value with a negative sign is converted if this flag is not specified.)356)

Since footnote 356

356) The results of all floating conversions of a negative zero, and of negative values that round to zero, include a minus sign.

is not normative, we believe that the above change is needed.