delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/12/12/05:27:25

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-transfer-encoding:content-type; q=dns; s=default; b=WOh
ouRtTmDP73sZA9CuMR68ler515TcYHST+WD85ON5SyoWwZDPeGLL991Q+JYgqB01
aCsyZz/cJgnvM+POIgeBDjvPDzgpPLmbdYlyiz5E14u1CNHuC+NAUQRd6VdXAc4W
zlSXk0+1LXwJHEARiZYFrLKha62ZV9hwpbginqGs=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-transfer-encoding:content-type; s=default; bh=VlZkiIdx5
cpy6Pe5ccR+/zvNfZc=; b=Sjv0SgLo0ZRNlaXB0r7N9rW9CrhLHf1VROA2fVrEd
+ctPc422FWN0VRiqKsjT7zDOzAFKDS6iETAUdGzU02s+t+gESVLKGW/FA32C+zsF
alPQ9B/KPdUeyIGQg3gdHcoPiTny58BwUmJHYkboXJAkwwXxhBVICd/LfuIhuw2h
RU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.1 spammy=HX-Languages-Length:791, 2147483648
X-HELO: mo4-p00-ob.smtp.rzone.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1576146389; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=K3Fe6HM1PyeGCkAvMG1WGoKpRNjlh5lbRIfnBj2oCBc=; b=T1jb0jminJRNjTYG7fflpwhEV05F9xZaQK5UUrlvDJ24WlGEm5/lrRm1fl3z0A3Z8+ 5RTm/pEzI2mlHQm9gPjN/elD3UHGNuprqw43cUY7IeuSC+p5Acqx+odDKZ6ZJlXdHcfu yQLKirz50kcmtAgv8ywcmfsKr/Ltz2kq+Tz/wuFU5PEONbMCctyvAIzF1GE8Q9+aDLtq +SL46xnMRenKmojgeeRcRob/25RDMfO4VnMB64Hs0pRpossmCCpqUhtwt3QmlDp43fbh Pxa52ZHYhY847edDZvTN1sMaaKv3ECIQS4YOh9hRGZUvpYEb7LHJ7ntQ+q3Kt5m1cXYV XVdg==
From: Bruno Haible <bruno AT clisp DOT org>
To: cygwin AT cygwin DOT com
Subject: ilogbl(0.0L) value is wrong
Date: Thu, 12 Dec 2019 11:26:23 +0100
Message-ID: <2040599.24iSPLvMXZ@omega>
User-Agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; )
MIME-Version: 1.0

POSIX [1] specifies that the return value of the functions ilogbf(), ilogb(),
ilogbl() for a zero argument should all be the same, namely FP_ILOGB0.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/ilogb.html

In Cygwin 2.9, the value of ilogbl(0.0L) is not right.

How to reproduce:
============================== foo.c ==============================
#include <stdio.h>
#include <float.h>
#include <math.h>

int main ()
{
  int x = ilogbf (0.0f);
  int y = ilogb (0.0);
  int z = ilogbl (0.0L);
  printf ("%d\n%d\n%d\n%d\n", x, y, z, FP_ILOGB0);
}
===================================================================
$ gcc -Wall foo.c
$ ./a.exe

Expected output: four times the same number.
Actual output:

-2147483647
-2147483647
-2147483648
-2147483647


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019