| 1 |
// Copyright 2023 Google LLC |
| 2 |
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 3 |
|
| 4 |
#ifndef Int96_DEFINED |
| 5 |
#define Int96_DEFINED |
| 6 |
|
| 7 |
#include <cstdint> |
| 8 |
|
| 9 |
namespace bentleyottmann { |
| 10 |
struct Int96 { |
| 11 |
int64_t hi; |
| 12 |
uint32_t lo; |
| 13 |
|
| 14 |
static Int96 Make(int32_t a); |
| 15 |
static Int96 Make(int64_t a); |
| 16 |
}; |
| 17 |
bool operator== (const Int96& a, const Int96& b); |
| 18 |
bool operator< (const Int96& a, const Int96& b); |
| 19 |
Int96 operator+ (const Int96& a, const Int96& b); |
| 20 |
Int96 multiply(int64_t a, int32_t b); |
| 21 |
Int96 multiply(int32_t a, int64_t b); |
| 22 |
|
| 23 |
|
| 24 |
} // namespace bentleyottmann |
| 25 |
#endif // Int96_DEFINED |