From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by sourceware.org (Postfix) with ESMTPS id C9F603858D39 for ; Wed, 29 Dec 2021 01:57:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C9F603858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb32.google.com with SMTP id y130so34175344ybe.8 for ; Tue, 28 Dec 2021 17:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=o/d7P+jSndah+Y/uvSA5jv5j7fzrhNwkPEDyhgEwkgc=; b=mRtSmt2rEj9xQ8OE2vnamcjLpv9lDZ0DLU57yHdtukrGL3yMWCBwpBgFihgrW5HQ1/ diQNVg5YkoT1xmZo3vs8Wmjf1Rqnfsray/Q4NfvCrXMmXkWDBo7QPI511PF6J3UV+Exi ECf7BY4mTzJPaTG5INQfj0alWP7XuvW8JPle/9hnJ/L/0x1CsGaNc6YDsHdLyWeKJv4r R1PYMbyYxToZvOf6TwlnAeRRh07auxA0eNCH0qjQjSzLzLDMtv6u/lvunqj7Ngso18Mc MXv0GMqmb9qoYmpNpK7FQHXT0FOv2E2X0qyzURUYaepP1fe+R34uBfwAJ83pLOcDPp6n Gh1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=o/d7P+jSndah+Y/uvSA5jv5j7fzrhNwkPEDyhgEwkgc=; b=piY2cNNejPAJj3jkPy/UsiNdLa//yyO0YkvWchDXXyZXJlVxdmz1so02Jh0gY77xzd Ir0NGyXmyjLfO7NbDOcxsbyZix7q8xVlb2Irp3B5s4wNEoM5eFdvk8SLHNbQiSp5pSjY Rc17DfWn6QAINRqY1jJKrP9nFrD0wO89Q5shIfr3sWPCI2lMeYvSECk2vUyLYgjgl2vF qoXxAakDm7cotmXalRtHWny5JNlez7tbukgy1RohhVFzXKUSX9m8dEe+2WMc4HN/O6/H jDNyU4fHCGaylEhf8D4hhFgsBzsvkh0IV/4pc+b73iaBZkQKSOfHKAhXBQtKDj9OQi76 c7oQ== X-Gm-Message-State: AOAM533FgzCgs9I554yw/qn7eb/fTyyUpQn2psWnGBjq/hnHGsqnBrRO RuQtwu62kgDNAlrhd5R8FPDQ3rWZTOHKJ4XqT05BSrYcrpA= X-Google-Smtp-Source: ABdhPJw28iSc29DfQU0i1zXdhQTxCm9s9ejCGpDGomMboNvFqx1sZdU3W/jyAwDrxo9XJbVf1A0riPuNJ/6ipW5sVzw= X-Received: by 2002:a25:5095:: with SMTP id e143mr18868915ybb.726.1640743037022; Tue, 28 Dec 2021 17:57:17 -0800 (PST) MIME-Version: 1.0 From: Keith Thompson Date: Tue, 28 Dec 2021 17:57:05 -0800 Message-ID: Subject: Errors in math function man pages To: newlib@sourceware.org Cc: Keith Thompson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Dec 2021 01:57:18 -0000 There are two errors in the sqrt(3) man page, with similar errors in the man pages for most or all of the other math functions specified in . The math functions are implemented correctly as far as I can tell, but the man pages are out of date, reflecting the language as of the 1989 ANSI / 1999 ISO C standard. C89/C90 defined math functions only for type double, but C99 and later added corresponding functions for float and long double (with 'f' and 'l' suffixes), and also introduced a number of new functions. Using sqrt(3) man page as an example, it mentions sqrt and sqrtf, but does not mention sqrtl. Second, it says: > sqrt is ANSI C. sqrtf is an extension. That was true as of C89/C89, but sqrt, sqrtf, and sqrtl are all defined by ISO C 1999 and later. (And I suggest referring to "ISO C" rather than the ambiguous "ANSI C".) The same problem appears in most or all of the man pages for functions declared in . Another example: the man page for asinh (inverse hyperbolic sine) says: > Neither asinh nor asinhf are ANSI C. As of C99 and later, asinh, asinhf, and asinhl are all ISO C. I *think* this is the list of source files that would need to corrected to bring the man pages up to date: newlib/libm/math/s_asinh.c newlib/libm/math/s_atan.c newlib/libm/math/s_erf.c newlib/libm/math/s_sin.c newlib/libm/math/s_tanh.c newlib/libm/math/w_acosh.c newlib/libm/math/w_atan2.c newlib/libm/math/w_atanh.c newlib/libm/math/w_exp.c newlib/libm/math/w_fmod.c newlib/libm/math/w_gamma.c newlib/libm/math/w_hypot.c newlib/libm/math/w_log10.c newlib/libm/math/w_pow.c newlib/libm/math/w_sinh.c newlib/libm/math/w_sqrt.c newlib/libm/mathfp/e_acosh.c newlib/libm/mathfp/e_atanh.c newlib/libm/mathfp/e_hypot.c newlib/libm/mathfp/er_lgamma.c newlib/libm/mathfp/s_asinh.c newlib/libm/mathfp/s_atan.c newlib/libm/mathfp/s_atan2.c newlib/libm/mathfp/s_atangent.c newlib/libm/mathfp/s_erf.c newlib/libm/mathfp/s_exp.c newlib/libm/mathfp/s_fmod.c newlib/libm/mathfp/s_log10.c newlib/libm/mathfp/s_pow.c newlib/libm/mathfp/s_sine.c newlib/libm/mathfp/s_sineh.c newlib/libm/mathfp/s_sqrt.c newlib/libm/mathfp/s_tanh.c