X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9B783950C6A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1603797436; bh=j5IHd2gFBJcS/d4+EymvqHts2NBeq6Nu/DtVplhkh3k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Rch/HqRWDx8ungB364nCAMmRWCjl/XDnjvTZDC2ssD3xnvFFKQQrCHGSWN1fjPVzy +5AeC4OfPjlSCrEHNNovCmHHi9LFKCnefuB3F7Zbl9NGsYgDpQG/TOj+EWsw9s8yWs 2iS288wv+Wce9Nz6P85OVxoKCGn2LkM/fbtuGVc4= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E51363950C78 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin AT cygwin DOT com Subject: sqrtl behavior inconsistent with sqrt and sqrtf Date: Tue, 27 Oct 2020 07:17:01 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (cygwin) Cancel-Lock: sha1:iwO1Yxk6HWD9d/M9qDZ/w9J9obo= X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_GOODAOL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: airplanemath via Cygwin Reply-To: airplanemath Sender: "Cygwin" --=-=-= Content-Type: text/plain Compiling and running the attached program with the command line below produces the output below: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=test_sqrt.c Content-Description: Test program for sqrtl, sqrt, and sqrtf #include #include int main() { long double a, b; double c, d; float f, g; a = (long double) -INFINITY; c = (double) -INFINITY; f = (float) -INFINITY; b = sqrtl(a); d = sqrt(c); g = sqrtf(f); printf("Long double: %4Lf %4Lf\n", a, b); printf("Double: %4lf %4lf\n", c, d); printf("Float: %4f %4f\n", f, g); return 0; } --=-=-= Content-Type: text/plain $ gcc -O0 -Og test_sqrt.c -o test_sqrt && ./test_sqrt Long double: -inf -inf Double: -inf -nan Float: -inf -nan I suspect the behavior for long double should be the same as for double and float (sqrt(-inf) = nan), but I'm not sure where to change that. I'm running a snapshot of Cygwin 3.2.0, if that's important. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple --=-=-=--