Good evening,

> On 4. Jun 2022, at 22:38, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> Yes. Negative time makes me twitchy...
> 
>> And yes, the reason 'FRACTION()' does that explicit unsigned thing is
>> because negative values don't have sane well-defined behavior wrt
>> division and modulus in C (ie the division rounding towards zero will
>> then cause a negative fractional value).
>> 
>> Your SIGNED_FRACTION() avoids that problem, but it does seem a bit
>> questionable to ever show negative values in things that want
>> fractions (which are generally physical units: time, depth, things
>> like that).
> 
> I think I have to agree with that. This is mathematically sane, but I 
> question the practicality…


please note it’s not negative stop times but negative time differences: In 
those particular circumstances, you have to do 13 seconds less decompression 
stops for every minute you further spend at 10m. This totally makes sense to me 
(I admit it’s a rare situation that deco stops get shorter for extended bottom 
time) and also displaying the 13 seconds as 0:13 (which is the output of 
FRACTION or  SIGNED_FRAC in that case) seems the natural way to me.

Best
Robert

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to