Changeset 3f3514aa in mainline
- Timestamp:
- 2018-07-05T21:41:22Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 08be4a4
- Parents:
- 2fe861d
- git-author:
- Dzejrou <dzejrou@…> (2018-05-02 17:32:27)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:22)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/internal/builtins.hpp
r2fe861d r3f3514aa 42 42 */ 43 43 44 #include <cstdlib> 45 44 46 namespace std::aux 45 47 { 46 48 template<class T> 47 double log2(T val)49 constexpr double log2(T val) 48 50 { 49 51 return __builtin_log2(static_cast<double>(val)); … … 51 53 52 54 template<class T> 53 double pow2(T exp)55 constexpr double pow2(T exp) 54 56 { 55 return __builtin_pow(2.0, static_cast<double>( val));57 return __builtin_pow(2.0, static_cast<double>(exp)); 56 58 } 57 59 58 60 template<class T> 59 double ceil(T val) 61 constexpr size_t pow2u(T exp) 62 { 63 return static_cast<size_t>(pow2(exp)); 64 } 65 66 template<class T> 67 constexpr double ceil(T val) 60 68 { 61 69 return __builtin_ceil(static_cast<double>(val));
Note:
See TracChangeset
for help on using the changeset viewer.