Skip to content

Commit 00e820b

Browse files
committed
use fixed precision for seed generation since size_t is different on at least armv7
1 parent 7f7ed67 commit 00e820b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/cpp/fs/Model.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,12 @@ map<DurationSize, shared_ptr<ProbabilityMap>> Model::runIterations(
723723
// use independent seeds so that if we remove one threshold it doesn't affect the other
724724
// HACK: seed_seq takes a list of integers now, so multiply and convert to get more digits
725725
// NOTE: use abs() because negative numbers act differently on arm64 vs x64 vs windows
726-
// NOTE: was matching to 15 digits (digits10 - 6) but use half precision so less likely
727-
// mismatches happen on different hardware/os combinations
728-
constexpr auto precision = std::numeric_limits<size_t>::digits10 / 2;
726+
// // NOTE: was matching to 15 digits (digits10 - 6) but use half precision so less likely
727+
// // mismatches happen on different hardware/os combinations
728+
// constexpr auto precision = std::numeric_limits<size_t>::digits10 / 2;
729+
// NOTE: std::numeric_limits<size_t>::digits10 varies on different hardware
730+
constexpr auto precision = 10;
731+
static_assert(std::numeric_limits<size_t>::digits10 >= precision);
729732
const auto lat = static_cast<size_t>(abs(start_point.latitude()) * pow(10, precision));
730733
const auto lon = static_cast<size_t>(abs(start_point.longitude()) * pow(10, precision));
731734
logging::debug(

0 commit comments

Comments
 (0)