proxygen
Math.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cmath>
20 
21 namespace folly {
22 
23 #ifndef __ANDROID__
24 
29 /* using override */ using std::nextafter;
30 
31 #else // !__ANDROID__
32 
40 #if defined(__GNUC__) && !defined(__clang__)
41 
42 constexpr float nextafter(float x, float y) {
43  return __builtin_nextafterf(x, y);
44 }
45 
46 constexpr double nextafter(double x, double y) {
47  return __builtin_nextafter(x, y);
48 }
49 
50 constexpr long double nextafter(long double x, long double y) {
51  return __builtin_nextafterl(x, y);
52 }
53 
54 #else // __GNUC__
55 
56 inline float nextafter(float x, float y) {
57  return ::nextafterf(x, y);
58 }
59 
60 inline double nextafter(double x, double y) {
61  return ::nextafter(x, y);
62 }
63 
64 inline long double nextafter(long double x, long double y) {
65  return ::nextafterl(x, y);
66 }
67 
68 #endif // __GNUC__
69 
70 #endif // __ANDROID__
71 } // namespace folly
Definition: InvokeTest.cpp:58
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
Definition: InvokeTest.cpp:65