[PATCH] Remove log2 define

Corinna Vinschen vinschen@redhat.com
Fri Aug 24 14:52:00 GMT 2018


On Aug 24 14:37, Wilco Dijkstra wrote:
> Since newlib now has a fast implementation of log2,

Only if !__OBSOLETE_MATH

> remove a define which
> avoids calling log2.  The define makes math code slower and less accurate,
> so removing it is best.
> 
> Build OK on AArch64, OK for commit?
> 
> --
> diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
> index 893a5d0645148af0dd0a48f7e73504e07363a840..2d17dd13e52ae1893beba8c9a2565d7682dbbf89 100644
> --- a/newlib/libc/include/math.h
> +++ b/newlib/libc/include/math.h
> @@ -329,9 +329,6 @@ extern double lgamma (double);
>  extern double erf (double);
>  extern double erfc (double);
>  extern double log2 (double);
> -#if !defined(__cplusplus)
> -#define log2(x) (log (x) / _M_LN2)
> -#endif
>  
>  #ifndef __math_68881
>  extern double hypot (double, double);

Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20180824/0af5c515/attachment.sig>


More information about the Newlib mailing list