• Re: math error in addition

    From Harald Oehlmann@21:1/5 to All on Thu Jan 18 09:26:37 2024
    Am 18.01.2024 um 07:39 schrieb Yahalom Emet:
    What is wrong with the Tcl addition:
    % clock format 1698526800
    Sun Oct 29 00:00:00 IDT 2023
    % expr 1698526800+86400
    1698613200
    % clock format 1698613200
    Sun Oct 29 23:00:00 IST 2023

    The addition should be 1698699600

    Am I missing something?

    Quickly looking at your example:

    expr 1698526800+86400

    1698526800
    + 86400
    =
    1698526800
    + 400
    + 6000
    + 80000
    =
    1698527200
    + 6000
    + 80000
    =
    1698533200
    + 80000
    =
    1698623200
    ----------

    I come to the same result as expr. Am I missing something?
    About clock, it is always good to also specify the time.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Thu Jan 18 11:52:44 2024
    * Yahalom Emet <[email protected]>
    | What is wrong with the Tcl addition:
    | % clock format 1698526800
    | Sun Oct 29 00:00:00 IDT 2023
    | % expr 1698526800+86400
    | 1698613200
    | % clock format 1698613200
    | Sun Oct 29 23:00:00 IST 2023

    | The addition should be 1698699600

    | Am I missing something?

    To explain why you expect the addition to give a clearly wrong result?
    ...800 + ...400 can't result in ...600, it needs to result in ...200.

    Did you miss the transition from DST no non-DST indicated by the time
    zones?

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)