[Cfp-interest 1886] Re: Negative

Jim Thomas jaswthomas at sbcglobal.net
Sun Jan 10 14:51:30 PST 2021



> On Dec 25, 2020, at 7:37 PM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> Attached is a first pass at the paper about negative zero.
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com <mailto:tydeman at tybor.com>      Testing, numerics, programming
> +1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com <http://www.tybor.com/>
> Savers sleep well, investors eat well, spenders work forever.
> 
> 
> Submitter:CFP group
> Submission Date: 2021-??-??
> Document: WG14 26yy
> Title: 26yy: 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 signed value is converted if this flag is not specified.)300)

What is a “negative signed value”? I believe it’s intended to mean a signed value with a negative sign, though it might be interpreted as a signed value that its negative. Using an adverb might help: negatively signed value.

What should happen with NaNs? I don’t believe C says that NaN values are signed, or unsigned.

- Jim Thomas
> 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 signed value 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.
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net <mailto:Cfp-interest at oakapple.net>
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest <http://mailman.oakapple.net/mailman/listinfo/cfp-interest>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20210110/3ae1708e/attachment-0001.htm>


More information about the Cfp-interest mailing list