#ifndef V8_BASE_OVERFLOWING_MATH_H_
#define V8_BASE_OVERFLOWING_MATH_H_
#include <stdint.h>
#include <cmath>
#include <type_traits>
#include "src/base/macros.h"
namespace v8 {
namespace base {
#define ASSERT_SIGNED_INTEGER_TYPE …
#define OP_WITH_WRAPAROUND …
OP_WITH_WRAPAROUND
OP_WITH_WRAPAROUND
OP_WITH_WRAPAROUND
template <>
inline int16_t MulWithWraparound(int16_t a, int16_t b) { … }
#undef OP_WITH_WRAPAROUND
template <typename signed_type>
inline signed_type NegateWithWraparound(signed_type a) { … }
template <typename signed_type>
inline signed_type ShlWithWraparound(signed_type a, signed_type b) { … }
#undef ASSERT_SIGNED_INTEGER_TYPE
template <typename T>
inline T Divide(T x, T y) { … }
inline float Recip(float a) { … }
inline float RecipSqrt(float a) { … }
}
}
#endif