Changeset 92b7b05e in Lumiera
- Timestamp:
-
2026-09-20T23:05:53Z
(3 weeks ago)
- Author:
- Ichthyostega <prg@…>
- Branches:
- dev/play
- Children:
- 206f963
- Parents:
- c0cff8a
- git-author:
- Ichthyostega <prg@…> (20/09/26 21:49:41)
- git-committer:
- Ichthyostega <prg@…> (20/09/26 23:05:53)
- Message:
-
Parameters: solve mixed signed / unsigned computation
There are some corner cases where the C++ number promotion rules can hurt us badly.
Devised a type selection logic to pick a suitable common numeric type explicitly,
using std::common_type<T1,T2> in most cases, yet handling explicitly the
case when the computation would wrap into unsigned; in such a mixed sign integral case,
we either use int64_t (when its precision suffices), or long double,
which can hold 64bit of mantissa without precision loss.
-
(No files)
-