|
KiCad PCB EDA Suite
|
128-bit integers for exact products of 64-bit coordinate deltas. More...
Go to the source code of this file.
Namespaces | |
| namespace | KIGEOM_WIDE |
Typedefs | |
| using | KI_INT128 = __int128 |
| using | KI_UINT128 = unsigned __int128 |
Functions | |
| double | KIGEOM_WIDE::WordsToDouble (int64_t aHi, uint64_t aLo) |
| Nearest double to hi * 2^64 + lo, ties to even. | |
| double | ToDouble (KI_INT128 aValue) |
| constexpr KI_INT128 | CrossWide (const VECTOR2L &aA, const VECTOR2L &aB) |
| Exact aA.x * aB.y - aA.y * aB.x. | |
| constexpr KI_INT128 | DotWide (const VECTOR2L &aA, const VECTOR2L &aB) |
| Exact aA.x * aB.x + aA.y * aB.y. | |
128-bit integers for exact products of 64-bit coordinate deltas.
Coordinates span 2^32 units, so deltas need 33 bits and their cross and dot products need 66. KI_INT128 holds those products exactly.
Definition in file wide_int.h.
| using KI_INT128 = __int128 |
Definition at line 91 of file wide_int.h.
| using KI_UINT128 = unsigned __int128 |
Definition at line 92 of file wide_int.h.
Exact aA.x * aB.y - aA.y * aB.x.
Never overflows for any int64 components.
Definition at line 104 of file wide_int.h.
References VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CalcArcCenter(), KIGEOM::OrientationSign(), and SEG::SquaredDistance().
Exact aA.x * aB.x + aA.y * aB.y.
Overflows only when all four components are INT64_MIN.
Definition at line 113 of file wide_int.h.
References VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 94 of file wide_int.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CalcArcCenter(), SEG::SquaredDistance(), and TUNER_SLIDER::updateSlider().