|
2025-03-11
| ||
| 19:07 | • Ticket [482db1d796] Wrong result from simple clock arithmetic (`clock add` with ... artifact: 45ef10d1c0 user: sebres | |
| 18:45 | • Closed ticket [482db1d796]. artifact: 97c0105030 user: sebres | |
| 18:37 | merge 9.0 (fix for [482db1d796540e68]) check-in: 16f05b6fc9 user: sebres tags: trunk, main | |
| 18:36 | merge 8.7: fixes [482db1d796540e68], some minor optimizations and another corner cases for a compile... check-in: 57d18c0efc user: sebres tags: core-9-0-branch | |
| 17:53 | fixes [482db1d796540e68]: local seconds of day shall be always positive, also for negative base (mod... check-in: 27cbd7afc6 user: sebres tags: core-8-branch | |
| 17:51 | added test coverage for `clock add` with negative base (bug [482db1d796540e68]) check-in: 663f0dad21 user: sebres tags: core-8-branch | |
| 17:41 | • Ticket [482db1d796] Wrong result from simple clock arithmetic (clock add). s... artifact: d23721255d user: sebres | |
| 14:25 | • New ticket [482db1d796]. artifact: a8fab71537 user: sbron | |
Wrong result from simple clock arithmetic (`clock add` with negative base).
The reason is a bug by porting [clock add] from Tcl to C - calculating seconds of day on a negative base generates negative result in C (-82800 instead of 3600 as it'd be in Tcl), so after all the seconds of day are wrong and the whole result deviate by one day:
Fixing it now for 8.7+, add coverage, etc...
- UTC -631152000 => LOCTM -631148400 % 86400 == -82800 // C vs.
+ UTC -631152000 => LOCTM -631148400 % 86400 == 3600 ## Tcl
Basically fixed in [27cbd7afc65a5c79], but found more places for a compiler "fix" (signed-mod operation with potentially negative dividend), so added more corrections in [e33fcd57b0397d45] (including few code simplifications and normalizations).
Test coverage is added too, so I close the ticket as fixed for now.