<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Regarding integer formats, C 6.2.6.2 says<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">If the implementation supports negative zeros, they shall be generated only by: </div><div class="">— the &, |, ^, ~, <<, and >> operators with operands that produce such a value; </div><div class="">— the+,- , *, /, and % operators where one operand is a negative zero and the result is zero; </div><div class="">— compound assignment operators based on the above cases. </div><div class="">It is unspecified whether these cases actually generate a negative zero or a normal zero, and whether a negative zero becomes a normal zero when stored in an object.</div></blockquote><div class=""><br class=""></div><div class="">I think this is consistent with not interpreting the sign of zero.</div><div class=""><br class=""></div><div class="">And it implies that specification like llogb(1) = 0 doesn’t allow a negative zero to be returned.</div><div class=""><br class=""></div><div class="">- Jim Thomas<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 23, 2018, at 10:39 AM, Stephen Canon <<a href="mailto:scanon@apple.com" class="">scanon@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">C doesn’t interpret the sign of zero in integer formats, right? Both encodings are just “zero”. I’m not sure there’s actually a distinction to be made here.<br class=""><br class=""><blockquote type="cite" class="">On Aug 23, 2018, at 12:49 PM, Jim Thomas <<a href="mailto:jaswthomas@sbcglobal.net" class="">jaswthomas@sbcglobal.net</a>> wrote:<br class=""><br class="">Hmm. Is there any other place cfp specifies the sign of a zero in integer format?<br class=""><br class="">754 says "logB(1) is +0”. This is in a context that applies to logB functions that return in floating-point or integer formats. I’m guessing that the sign in +0 is not intended to apply to logB functions that return in integer format. I don’t believe there’s any other place 754 specifies the sign of a zero in integer format. We can ask the 754 committee.<br class=""><br class="">- Jim Thomas<br class=""><br class=""><blockquote type="cite" class="">On Aug 22, 2018, at 7:57 PM, Fred J. Tydeman <<a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a>> wrote:<br class=""><br class="">On Tue, 21 Aug 2018 15:09:37 -0700 Jim Thomas wrote:<br class=""><blockquote type="cite" class=""><br class="">llogb and ilogb return in integer format, so we don't need to say anything about the sign of a zero result for them.<br class=""></blockquote><br class="">That is true for 2's complement, but not for 1's complement or sign-magnitude.<br class=""><br class=""><br class=""><br class="">---<br class="">Fred J. Tydeman Tydeman Consulting<br class=""><a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a> Testing, numerics, programming<br class="">+1 (702) 608-6093 Vice-chair of PL22.11 (ANSI "C")<br class="">Sample C99+FPCE tests: <a href="http://www.tybor.com" class="">http://www.tybor.com</a><br class="">Savers sleep well, investors eat well, spenders work forever.<br class=""></blockquote><br class=""><br class="">_______________________________________________<br class="">Cfp-interest mailing list<br class=""><a href="mailto:Cfp-interest@oakapple.net" class="">Cfp-interest@oakapple.net</a><br class="">http://mailman.oakapple.net/mailman/listinfo/cfp-interest<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div></body></html>