[Cfp-interest] llogb(1.)

Stephen Canon scanon at apple.com
Thu Aug 23 10:39:33 PDT 2018


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.

> On Aug 23, 2018, at 12:49 PM, Jim Thomas <jaswthomas at sbcglobal.net> wrote:
> 
> Hmm. Is there any other place cfp specifies the sign of a zero in integer format?
> 
> 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.
> 
> - Jim Thomas
> 
>> On Aug 22, 2018, at 7:57 PM, Fred J. Tydeman <tydeman at tybor.com> wrote:
>> 
>> On Tue, 21 Aug 2018 15:09:37 -0700 Jim Thomas wrote:
>>> 
>>> llogb and ilogb return in integer format, so we don't need to say anything about the sign of a zero result for them.
>> 
>> That is true for 2's complement, but not for 1's complement or sign-magnitude.
>> 
>> 
>> 
>> ---
>> Fred J. Tydeman        Tydeman Consulting
>> 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
>> Savers sleep well, investors eat well, spenders work forever.
> 
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest




More information about the Cfp-interest mailing list