MCPcopy Create free account
hub / github.com/eggert/tz / omul

Function omul

zic.c:4096–4111  ·  view source on GitHub ↗

Return T1 * T2, but diagnose any overflow and exit. */

Source from the content-addressed store, hash-verified

4094/* Return T1 + T2, but diagnose any overflow and exit.
4095 This is like oadd, except the result must fit in min_time..max_time range,
4096 which on oddball machines can be a smaller range than ZIC_MIN..ZIC_MAX. */
4097ATTRIBUTE_PURE_114833_HACK
4098static zic_t
4099tadd(zic_t t1, zic_t t2)
4100{
4101 zic_t sum = oadd(t1, t2);
4102 if (min_time <= sum && sum <= max_time)
4103 return sum;
4104 time_overflow();
4105}
4106
4107/* Return T1 * T2, but diagnose any overflow and exit. */
4108ATTRIBUTE_PURE_114833_HACK
4109static zic_t
4110omul(zic_t t1, zic_t t2)
4111{
4112#ifdef ckd_mul
4113 zic_t product;
4114 if (!ckd_mul(&product, t1, t2))

Callers 3

gethmsFunction · 0.85
getleapdatetimeFunction · 0.85
rpytimeFunction · 0.85

Calls 1

time_overflowFunction · 0.85

Tested by

no test coverage detected