beanz added inline comments.

================
Comment at: clang/docs/LanguageExtensions.rst:642
  T __builtin_elementwise_log10(T x)          return the base 10 logarithm of x 
                               floating point types
+ T __builtin_elementwise_exp(T x)            returns the base-e exponential, 
or e^x, of the specified value   floating point types
+ T __builtin_elementwise_exp2(T x)           returns the base-2 exponential, 
or 2^x, of the specified value   floating point types
----------------
erichkeane wrote:
> The naming difference between these is a little clunky, but I dont use these 
> enough to know if this is a common pattern.  Its weird to me that _exp means 
> "e^x", but _exp2 means "2^x".  
Agreed that it seems odd, but in C and C++ math libraries `exp` is base-e, and 
`exp2` is base-2:

https://cplusplus.com/reference/cmath/exp/
https://cplusplus.com/reference/cmath/exp2/

It is probably best to be consistent with C here even if it is unintuitive at 
first glance.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145270/new/

https://reviews.llvm.org/D145270

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to