• Re: .5 against 0.5f

    From Janis Papanagnou@3:633/10 to All on Thu Oct 29 19:57:19 2026
    On 2026-10-29 09:30, David Brown wrote:
    On 29/10/2026 00:08, Janis Papanagnou wrote:
    On 2026-10-28 21:27, Keith Thompson wrote:
    [...]
    But 0.1f
    and 0.1 are of different types.˙ If they happen to behave the same way
    in some context, it's a consequence of the C language rules.

    Yes, sure. Only that I think that context should suffice to interpret
    "0.1" appropriately!


    Do you mean that you think it would have been better if the rules of C
    were different, so that the context always determined how "0.1" was to
    be interpreted?

    (I think my opinion here is irrelevant since "C" is what it is.)

    But, yes, my question was whether it would haven been necessary
    (language design-wise!) to have those tags in the first place.

    That's not an unreasonable feature for a programming
    language - AFAIUI, that is how numeric literals work in Ada.˙ But it is
    not how things work in C, where the value and type of an expression is determined entirely by the expression itself, independently of the context.

    I hate to try to speculate as to whether the C philosophy or the Ada philosophy here is more common -

    (I also have no interest in speculations.)

    but I don't know of any languages other
    than Ada that make the type of literals dependent on their use or
    context.˙ There are of course many languages that might follow the Ada
    path, unbeknownst to me.˙ (You can have fun making class types in C++,
    and no doubt other languages, that emulate this behaviour, but it is not part of the language.)

    (Here I had started writing examples from other languages, but it
    got long and no end to see, and it's anyway most likely considered
    off-topic, so I decided to just stop here.)

    Thanks for your elaborations on the question.

    Janis

    [...]


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Thu Oct 29 19:49:03 2026
    In article <11bvqbn$3g0tj$1@dont-email.me>,
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 2026-10-28 21:50, Steven G. Kargl wrote:
    On Wed, 28 Oct 2026 17:59:19 -0700, Tim Rentsch wrote:

    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Wed, 28 Oct 2026 16:39:00 -0700, Keith Thompson wrote:

    (Also, you misspelled "ROFL", and you don't need parentheses on the
    return statement, particularly if you dislike fluff.)

    Yeah, I was laugh too hard while typing ;-)

    Parentheses is a habit from BSD kernel source file style guide.

    Now is a good time to start unlearning that habit.

    Why? What harm do the parentheses cause?

    They can lead to people thinking that return is a function, even if they >nominally know better.

    What? This is an incredibly weak argument.

    If someone thought that `return` was a function, then why
    wouldn't they think that `if` or `while` were also functions?
    Or `sizeof`, and so on?

    What would you think of

    return (a=b).retval;

    You might never write such code, and might never read it either, but you >should have no trouble parsing it. Do you?

    I would think that code is bad, and unnecessarily obscure, but
    perhaps someone _would_ write this code.

    struct v {
    int retval;
    };

    struct v a;

    int
    something(void)
    {
    struct v b;
    b.retval = 1;
    return (a=b).retval;
    }

    Of course, it would make no difference if the `return` statement
    were written as,

    return ((a=b).retval);

    But again, the whole premise (that a programmer familiar with C
    would ever think that `return` is a function) is silly.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Thu Oct 29 20:56:39 2026
    On 29/10/2026 19:57, Janis Papanagnou wrote:
    On 2026-10-29 09:30, David Brown wrote:
    On 29/10/2026 00:08, Janis Papanagnou wrote:
    On 2026-10-28 21:27, Keith Thompson wrote:
    [...]
    But 0.1f
    and 0.1 are of different types.˙ If they happen to behave the same way >>>> in some context, it's a consequence of the C language rules.

    Yes, sure. Only that I think that context should suffice to interpret
    "0.1" appropriately!


    Do you mean that you think it would have been better if the rules of C
    were different, so that the context always determined how "0.1" was to
    be interpreted?

    (I think my opinion here is irrelevant since "C" is what it is.)

    There's nothing wrong with having an opinion on what might or might not
    have been better, or what you might like in other languages. The
    pointless discussions come from claiming C can be, or needs to be, "fixed".

    But it's fine to stop here if you like.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Thu Oct 29 13:39:55 2026
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

    Note: my argumentation is based on questioning the existence of 'F'.
    So I'd appreciate to hear of any enlightening application cases, ones
    that would be impossible when 'F' in literals wouldn't be present.

    In C the word is constants, not literals.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Thu Oct 29 22:55:31 2026
    On 2026-10-29 20:49, Dan Cross wrote:
    [...]

    But again, the whole premise (that a programmer familiar with C
    would ever think that `return` is a function) is silly.

    Yes, that's hard to believe.

    I've heard the argument somehow reversed, alike "You don't need
    the parenthesis since 'return' is a statement (and no function)."
    IOW, it was not about mistaking 'return' for a function, more to
    make its _character as statement_ clear (and by that, en passant,
    invalidate K&R's paragon which had been widely followed back then).

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Thu Oct 29 23:06:59 2026
    On 2026-10-29 20:56, David Brown wrote:

    There's nothing wrong with having an opinion on what might or might not
    have been better, or what you might like in other languages.˙ The
    pointless discussions come from claiming C can be, or needs to be, "fixed".

    "Abandon all hope, ye who enter here." :-)

    But it's fine to stop here if you like.

    Yes, I think it makes little sense. It's also hard to compare
    languages on a specific feature alone without taking its whole
    design into account. The 'F' tag is just a detail of the issue
    (or "issue", in quotes, if you prefer) with types in "C". (IMO)

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Thu Oct 29 23:19:48 2026
    On 2026-10-29 13:01, Keith Thompson wrote:
    makendo <makendo@makendo.invalid> writes:
    I ordered a couple of blu-rays from amazon last week, and the
    confirmation email had the following for the total price:
    Total
    75.71000000000001 USD
    Appears they may be using FP instead of integer fixed point
    arithmetic
    for pricing.

    And this is why you should use the lowest value denominator when
    storing monetary values -- store USD values in cents, CNY values
    in fen, EUR values in cents, etc...
    [...]

    That's not good enough. Discounts, sales taxes, and compound
    interest can easily result in amounts that are not multiples of
    one cent, which must then be rounded or truncated to the nearest
    cent following whatever financial rules are in effect.

    We also have to consider conversions of currencies between states
    in international trade, or, at times, switch of a currency unit;
    e.g. 1 Euro = 1,95583 DEM (note the officially defined number of
    decimals).

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Thu Oct 29 15:42:26 2026
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Wed, 28 Oct 2026 17:59:19 -0700, Tim Rentsch wrote:

    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Wed, 28 Oct 2026 16:39:00 -0700, Keith Thompson wrote:

    (Also, you misspelled "ROFL", and you don't need parentheses on the
    return statement, particularly if you dislike fluff.)

    Yeah, I was laugh too hard while typing ;-)

    Parentheses is a habit from BSD kernel source file style guide.

    Now is a good time to start unlearning that habit.

    Why? What harm do the parentheses cause?

    Wrong question. The important question is what benefit do they
    give? Granted, there may be circumstances where there is some
    benefit. But what benefit justifies using parentheses in *all*
    circumstances?

    Unlearning is not likely to happen. I've been a long-time
    contributor to FreeBSD, and have no plans to stop. Feel
    free to check the git history on FreeBSD libm sources.
    My finger prints are all over the code. So, yeah, I know
    a enough about floating point arithmetic and C standard
    requirements to be dangerous.

    % man 9 style
    ...

    Values in return statements should be enclosed in parentheses.


    I also have debugging macros RETURNI() that require parens.

    That strengthens the motivation not to use parentheses with
    return statements, to emphasize that they are different from
    the macros.

    Do you ignore the style requirements of all the projects
    that you may have worked on, and simply use whatever
    your personal preferences are?

    Please note what I said. I did not say never to use parentheses.
    What I did say is that now is a good time to start unlearning the
    habit of (always) using parentheses. If you're writing code
    destined for FreeBSD, by all means put in the extra parentheses.
    On the other hand, if you're writing code to put in a posting for
    comp.lang.c, it's more common not to use extra parentheses. When
    in Rome, do as the Romans do. If you have a compelling reason to
    use such redundant parentheses here in the newsgroup, please tell
    us what it is. Otherwise, is it you who is ignoring the style
    norms of the group who will be reading your code?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Thu Oct 29 15:47:26 2026
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Thu, 29 Oct 2026 10:45:16 +0100, David Brown wrote:

    Let me put it another way. What benefit do you think there is from
    these parentheses? Why does the FreeBSD style guide recommend them?
    I can see benefits in consistency of style once that usage has been
    established, but why have them in the first place?

    As we all know, FreeBSD is derived from software developed by
    the CSRG at UC Berkeley during the 70's. FreeBSD adopted the
    Kernel Normal Format (KNF) from CSRG. You will need to contact
    a former member of CSRG such as Bostik, McKusick, Joy, Leffler,
    etc. and them why KNF requires ().

    Perhaps, the C compiler from 40 or so years ago required
    parentheses in a return statement. Or, just maybe, members of
    CSRG read K&R and noticed the authors of the book consistently
    use paretheses in their examples. Ah yes, let's look at
    the documentation:

    % man 9 style

    HISTORY
    This manual page was originally based on the src/admin/style/style
    file from the 4.4BSD-Lite2 release, with frequent updates to
    reflect the current practice and desire of the FreeBSD project.
    src/admin/style/style is a codification by the CSRG of the
    programming style of Ken Thompson and Dennis Ritchie in Version6
    AT&T UNIX.

    So, it seems to be a preference of Ritchie.

    It may have been simply long-standing habit rather than preference.
    In the early days of C parentheses around return expressions were
    required, not optional. I've been programming in C long enough to
    have been influenced by that requirement (and later learned to undo
    it).

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 29 16:06:03 2026
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:
    On Thu, 29 Oct 2026 11:56:38 -0400, James Kuyper wrote:
    On 2026-10-28 21:50, Steven G. Kargl wrote:
    [...]
    Why? What harm do the parentheses cause?

    They can lead to people thinking that return is a function, even if they
    nominally know better. What would you think of

    return (a=b).retval;

    You might never write such code, and might never read it either, but you
    should have no trouble parsing it. Do you?

    Never written nor seen such a line of code. Of course, a random
    line of code taken out of context may have many interpretations
    or no interpretation at all. I likely know less than 25% of
    what C can do as I am primarily interested in only C23 7.12 and
    Annex F and G.

    (7.12 is <math.h>; Annexes F and G are ISO/IEC 60559 arithmetic.)

    The question isn't whether you've ever seen such code (which I'm
    guessing James made up as an example). The question is whether
    you can easily understand it. Someone who had a mental model that
    return requires parentheses would likely have trouble with it. (And
    in fact very early versions of C did require parentheses on return
    statements with an expression.)

    I do find it interesting that in a newgroup purportedly concerned
    with discussions about the C programming language, I seem to have
    been the only person in this thread to show a complete self-contained
    piece of code so fir can see the consequences of not understanding
    floating point arithmetic.

    You may be one of the few people who's willing to engage with fir.
    I didn't reply to him because I don't read his posts.

    Are you the same person as steve g <Sgonedes1977@gmail.com>?

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 29 16:29:32 2026
    cross@spitfire.i.gajendra.net (Dan Cross) writes:
    In article <11bvqbn$3g0tj$1@dont-email.me>,
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 2026-10-28 21:50, Steven G. Kargl wrote:
    On Wed, 28 Oct 2026 17:59:19 -0700, Tim Rentsch wrote:
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:
    On Wed, 28 Oct 2026 16:39:00 -0700, Keith Thompson wrote:
    (Also, you misspelled "ROFL", and you don't need parentheses on the >>>>>> return statement, particularly if you dislike fluff.)

    Yeah, I was laugh too hard while typing ;-)

    Parentheses is a habit from BSD kernel source file style guide.

    Now is a good time to start unlearning that habit.

    Why? What harm do the parentheses cause?

    They can lead to people thinking that return is a function, even if they >>nominally know better.

    What? This is an incredibly weak argument.

    If someone thought that `return` was a function, then why
    wouldn't they think that `if` or `while` were also functions?
    Or `sizeof`, and so on?

    I agree that it's a bit of a weak argument, but I wouldn't call it
    incredibly weak.

    In my personal coding style, I try to avoid making things that are not
    function calls look like function calls. In a function call, there's no
    space between the function name and the left parenthesis. I don't use
    that style for anything other than function calls (or invocations of function-like macros). Not because I don't know return and sizeof are keywords, but because it's just a little bit easier to read the code
    if distinctions like that are clear.

    Examples:

    func(42); // function call, or maybe a macro invocation
    return 42; // not return(42); or even "return (42);
    if (cond) // not if(cond)
    sizeof (int) // not sizeof(int)
    sizeof obj // not sizeof(obj) or sizeof (obj)

    The idea is to make the code just a little bit clearer and easier to
    read. If I see something that looks it would be a function call except
    that the prefix is a keyword, it's *very slightly* annoying.
    Parentheses on a return statement are allowed, but they're part of the expression, not part of the syntax of the return statement, and they're superfluous. I don't write `return (42);` for the same reason I don't
    write `x = (42);`.

    And of course *all* of these rules can be overridden by a coding
    standard or by the existing style of the surrounding code.

    [...]
    But again, the whole premise (that a programmer familiar with C
    would ever think that `return` is a function) is silly.

    The premise (at least for me) is not that someone would *think*
    that return is a function, but that making a return statement not
    look too much like a function call makes the code just a little
    bit easier to read.

    And in the example that started this subthread, I probably wouldn't
    have mentioned the parentheses if the poster hadn't been complaining
    about "fluff".

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 29 23:46:28 2026
    On Thu, 29 Oct 2026 11:56:38 -0400, James Kuyper wrote:

    They can lead to people thinking that return is a function ...

    There shouldn?t be a return statement at all. Smashing together the
    assignment of the function result with termination of function
    execution seems to me a code smell.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 29 16:46:38 2026
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:
    On Thu, 29 Oct 2026 10:45:16 +0100, David Brown wrote:

    Let me put it another way. What benefit do you think there is from
    these parentheses? Why does the FreeBSD style guide recommend them? I
    can see benefits in consistency of style once that usage has been
    established, but why have them in the first place?

    As we all know, FreeBSD is derived from software developed by
    the CSRG at UC Berkeley during the 70's. FreeBSD adopted the
    Kernel Normal Format (KNF) from CSRG. You will need to contact
    a former member of CSRG such as Bostik, McKusick, Joy, Leffler,
    etc. and them why KNF requires ().

    Perhaps, the C compiler from 40 or so years ago required
    parentheses in a return statement. Or, just maybe, members of
    CSRG read K&R and noticed the authors of the book consistently
    use paretheses in their examples. Ah yes, let's look at
    the documentation:

    % man 9 style

    HISTORY
    This manual page was originally based on the src/admin/style/style file
    from the 4.4BSD-Lite2 release, with frequent updates to reflect the
    current practice and desire of the FreeBSD project.
    src/admin/style/style is a codification by the CSRG of the programming
    style of Ken Thompson and Dennis Ritchie in Version˙6 AT&T UNIX.

    So, it seems to be a preference of Ritchie.

    A former preference.

    In the 1975 C reference manual, the syntax for a return statement was:

    return ;
    return ( expression ) ;

    In K&R1, 1978, the syntax was changed to:

    return ;
    return expression ;

    but parentheses were used in the examples.

    In K&R2, 1988, the examples did not use parentheses on return
    statements. (I don't know whether that was Ritchie's decision or
    Kernighan's.)

    It appears that the FreeBSD style rule is a relic of an earlier
    version of C that required the parentheses. AT&T V6 Unix was
    released in 1975.

    You can still use parentheses on return statements if you want to,
    and you should do so if you're operating under a coding standard
    that requires them. They're part of the syntax of the expression,
    not part of the syntax of the return statement. I probably wouldn't
    have said anything if you hadn't mocked the use of 25.0 or 25.0f
    rather than 25 as "fluff".

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 29 16:56:32 2026
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    Note: my argumentation is based on questioning the existence of 'F'.
    So I'd appreciate to hear of any enlightening application cases, ones
    that would be impossible when 'F' in literals wouldn't be present.

    In C the word is constants, not literals.

    For now. In the latest C2y draft, they're called literals.

    Proposal: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3189.htm Draft standard: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3998.pdf

    (You've said before that you dislike this change.)

    In any case, the term "literal" is unambiguous, even if it's not
    currently used by the C standard.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Fri Oct 30 00:21:30 2026
    On Thu, 29 Oct 2026 16:06:03 -0700, Keith Thompson wrote:

    You may be one of the few people who's willing to engage with fir.
    I didn't reply to him because I don't read his posts.

    I usually skip fir's post, but this one caught my eye
    as it was a question about floating point.

    Are you the same person as steve g <Sgonedes1977@gmail.com>?

    No.

    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 30 00:50:57 2026
    On Thu, 29 Oct 2026 18:04:52 +0800, makendo wrote:

    I envy in particular the Japanese on this -- they don't have
    monetary units smaller than 1 yen, and as such misuse of floats in
    monetary calculations are far less likely in Japan.

    1 yen = 100 sen = 1000 rin

    ?The sen and the rin were eventually taken out of circulation at
    the end of 1953?
    -- <https://en.wikipedia.org/wiki/Japanese_yen>

    How would you do calculations involving compound interest payments
    without floating-point arithmetic? And why would you want to?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Fri Oct 30 01:17:39 2026
    In article <86o6cckttt.fsf@linuxsc.com>,
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:
    On Thu, 29 Oct 2026 10:45:16 +0100, David Brown wrote:

    Let me put it another way. What benefit do you think there is from
    these parentheses? Why does the FreeBSD style guide recommend them?
    I can see benefits in consistency of style once that usage has been
    established, but why have them in the first place?

    As we all know, FreeBSD is derived from software developed by
    the CSRG at UC Berkeley during the 70's. FreeBSD adopted the
    Kernel Normal Format (KNF) from CSRG. You will need to contact
    a former member of CSRG such as Bostik, McKusick, Joy, Leffler,
    etc. and them why KNF requires ().

    Perhaps, the C compiler from 40 or so years ago required
    parentheses in a return statement. Or, just maybe, members of
    CSRG read K&R and noticed the authors of the book consistently
    use paretheses in their examples. Ah yes, let's look at
    the documentation:

    % man 9 style

    HISTORY
    This manual page was originally based on the src/admin/style/style
    file from the 4.4BSD-Lite2 release, with frequent updates to
    reflect the current practice and desire of the FreeBSD project.
    src/admin/style/style is a codification by the CSRG of the
    programming style of Ken Thompson and Dennis Ritchie in Version6
    AT&T UNIX.

    So, it seems to be a preference of Ritchie.

    It may have been simply long-standing habit rather than preference.
    In the early days of C parentheses around return expressions were
    required, not optional. I've been programming in C long enough to
    have been influenced by that requirement (and later learned to undo
    it).

    When? They were not required in typesetter C on 7th Edition
    Unix, which is more or less what K&R described, and the grammar
    in K&R1 just says `return _expression_;`:

    ```
    $ ed paren.c
    ?paren.c
    a
    #include <stdio.h>

    int
    foo()
    {
    return 2;
    }

    int
    main()
    {
    printf("foo() = %d\n", foo());
    return 0;
    }
    .
    w
    104
    q
    $ cc -o paren paren.c
    $ ./paren
    foo() = 2
    $
    ```

    Nor were they required in the rather different dialect used in
    6th Edition Unix:

    ```
    RESTRICTED RIGHTS

    Use, duplication or disclosure is subject to
    restrictions stated in Contract with Western
    Electric Company, Inc.

    login: root
    # cat >paren.c
    foo()
    {
    return 2;
    }

    int
    main()
    {
    printf("foo() = %d\n", foo());
    return 0;
    }
    # cc paren.c
    # ./a.out
    foo() = 2
    #
    ```

    Neither the parser in the 5th Edition compiler nor the 4th Ed
    compiler (the latter from the recently recovered tape found at
    Utah) requires parentheses in that position, either.

    They _are_ required in the earliest extant compiler sources from
    roughly 1972 (the `last1120c` and `prestruct-c` compilers
    recovered from DECtape and published by Dennis Ritchie on his
    web page), and it is true that the, "C Reference Manual" from
    6th Ed shows parentheses around the expression in a `return`
    statement; as mentioned, the 6th Ed compiler did not enforce
    this, however.

    It looks like parentheses were grammatically required around the
    expression in a `return` statement for a brief period ca. 1972,
    perhaps into early 1973, and never after that. Certainly, I do
    not believe that anyone posting here ever used one of the early
    compilers that required this, unless it was an ersatz
    implementation.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Fri Oct 30 01:27:03 2026
    In article <86se1oku25.fsf@linuxsc.com>,
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Wed, 28 Oct 2026 17:59:19 -0700, Tim Rentsch wrote:

    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Wed, 28 Oct 2026 16:39:00 -0700, Keith Thompson wrote:

    (Also, you misspelled "ROFL", and you don't need parentheses on the
    return statement, particularly if you dislike fluff.)

    Yeah, I was laugh too hard while typing ;-)

    Parentheses is a habit from BSD kernel source file style guide.

    Now is a good time to start unlearning that habit.

    Why? What harm do the parentheses cause?

    Wrong question. The important question is what benefit do they
    give? Granted, there may be circumstances where there is some
    benefit. But what benefit justifies using parentheses in *all* >circumstances?

    Consistency with existing code and conformance with an
    externally mandated style guide, obviously.

    Unlearning is not likely to happen. I've been a long-time
    contributor to FreeBSD, and have no plans to stop. Feel
    free to check the git history on FreeBSD libm sources.
    My finger prints are all over the code. So, yeah, I know
    a enough about floating point arithmetic and C standard
    requirements to be dangerous.

    % man 9 style
    ...

    Values in return statements should be enclosed in parentheses.


    I also have debugging macros RETURNI() that require parens.

    That strengthens the motivation not to use parentheses with
    return statements, to emphasize that they are different from
    the macros.

    Do you ignore the style requirements of all the projects
    that you may have worked on, and simply use whatever
    your personal preferences are?

    Please note what I said. I did not say never to use parentheses.
    What I did say is that now is a good time to start unlearning the
    habit of (always) using parentheses. If you're writing code
    destined for FreeBSD, by all means put in the extra parentheses.
    On the other hand, if you're writing code to put in a posting for >comp.lang.c, it's more common not to use extra parentheses. When
    in Rome, do as the Romans do. If you have a compelling reason to
    use such redundant parentheses here in the newsgroup, please tell
    us what it is. Otherwise, is it you who is ignoring the style
    norms of the group who will be reading your code?

    This newsgroup has no "norms" for code style. Period.

    You are stating your preference as if it is some agreed upon, de
    facto standard. It is not, nor is it a requirement for posting
    here. No one posting here is obligated to omit the parentheses
    to satisfy the whims of you, me, or anyone else. Hell, they can
    unironically use the GNU style if they really want.

    OP: you want to parenthesize the expression in a `return`
    statement because that's what you're used to from FreeBSD? Go
    for it. Some folks may find it unnecessary; that's fine. But
    don't listen to someone trying to tell you that you're violating
    some set of invisible mores by doing so; that nonsense.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Thu Oct 29 18:37:16 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> writes:

    On Thu, 29 Oct 2026 11:56:38 -0400, James Kuyper wrote:

    They can lead to people thinking that return is a function ...

    There shouldn't be a return statement at all. Smashing together
    the assignment of the function result with termination of function
    execution seems to me a code smell.

    It must be terrible to have such a highly sensitive nose in a world
    with so many heathen programming language designers.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Fri Oct 30 02:08:10 2026
    On Fri, 30 Oct 2026 01:27:03 -0000 (UTC), Dan Cross wrote:

    In article <86se1oku25.fsf@linuxsc.com>,
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Wed, 28 Oct 2026 17:59:19 -0700, Tim Rentsch wrote:

    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

    On Wed, 28 Oct 2026 16:39:00 -0700, Keith Thompson wrote:

    (Also, you misspelled "ROFL", and you don't need parentheses on the >>>>>> return statement, particularly if you dislike fluff.)

    Yeah, I was laugh too hard while typing ;-)

    Parentheses is a habit from BSD kernel source file style guide.

    Now is a good time to start unlearning that habit.

    Why? What harm do the parentheses cause?

    Wrong question. The important question is what benefit do they
    give? Granted, there may be circumstances where there is some
    benefit. But what benefit justifies using parentheses in *all* >>circumstances?

    Consistency with existing code and conformance with an
    externally mandated style guide, obviously.

    Unlearning is not likely to happen. I've been a long-time
    contributor to FreeBSD, and have no plans to stop. Feel
    free to check the git history on FreeBSD libm sources.
    My finger prints are all over the code. So, yeah, I know
    a enough about floating point arithmetic and C standard
    requirements to be dangerous.

    % man 9 style
    ...

    Values in return statements should be enclosed in parentheses.


    I also have debugging macros RETURNI() that require parens.

    That strengthens the motivation not to use parentheses with
    return statements, to emphasize that they are different from
    the macros.

    Do you ignore the style requirements of all the projects
    that you may have worked on, and simply use whatever
    your personal preferences are?

    Please note what I said. I did not say never to use parentheses.
    What I did say is that now is a good time to start unlearning the
    habit of (always) using parentheses. If you're writing code
    destined for FreeBSD, by all means put in the extra parentheses.
    On the other hand, if you're writing code to put in a posting for >>comp.lang.c, it's more common not to use extra parentheses. When
    in Rome, do as the Romans do. If you have a compelling reason to
    use such redundant parentheses here in the newsgroup, please tell
    us what it is. Otherwise, is it you who is ignoring the style
    norms of the group who will be reading your code?

    This newsgroup has no "norms" for code style. Period.

    You are stating your preference as if it is some agreed upon, de
    facto standard. It is not, nor is it a requirement for posting
    here. No one posting here is obligated to omit the parentheses
    to satisfy the whims of you, me, or anyone else. Hell, they can
    unironically use the GNU style if they really want.

    OP: you want to parenthesize the expression in a `return`
    statement because that's what you're used to from FreeBSD? Go
    for it. Some folks may find it unnecessary; that's fine. But
    don't listen to someone trying to tell you that you're violating
    some set of invisible mores by doing so; that nonsense.

    I have been lurking in c.l.c for over 2 decades. I know that
    there is no coding style guide, here. I have contributed code
    to both FreeBSD and GCC, again, for over 2 decades. I'm
    well-aware of the requirements in both FreeBSD's style(9) and
    the GNU coding standard. Neither use my preferred 3-space
    indentation at all indentation levels. Oh well.

    C23, Annex A shows the syntax rule: 'return expression_{opt}'
    with _{opt} denoting a subscript. Unsurprisingly, 6.5.2 shows

    primary-expression:
    ...
    ( expression )
    ...

    so, the code I posted with 'return (0)' is standard conforming.

    --
    steve


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 29 19:37:39 2026
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:
    [...]
    C23, Annex A shows the syntax rule: 'return expression_{opt}'
    with _{opt} denoting a subscript. Unsurprisingly, 6.5.2 shows

    primary-expression:
    ...
    ( expression )
    ...

    so, the code I posted with 'return (0)' is standard conforming.

    Of course, and nobody has suggested otherwise.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Fri Oct 30 03:57:56 2026
    On 2026-10-30 00:29, Keith Thompson wrote:
    [...]
    [...]

    In my personal coding style, I try to avoid making things that are not function calls look like function calls. In a function call, there's no space between the function name and the left parenthesis. [...]

    I suppose we should read the second sentence also as your "personal
    coding style". In my personal coding style there's usually always a
    space. (Exception to that habit is in user-defined functions' calls
    in Awk where it is required by the syntax, a is space disallowed.)

    [...]

    And in the example that started this subthread, I probably wouldn't
    have mentioned the parentheses if the poster hadn't been complaining
    about "fluff".

    Yeah, that was funny. :-)

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Fri Oct 30 04:22:00 2026
    On 2026-10-30 00:46, Lawrence D?Oliveiro wrote:
    On Thu, 29 Oct 2026 11:56:38 -0400, James Kuyper wrote:

    They can lead to people thinking that return is a function ...

    There shouldn?t be a return statement at all. Smashing together the assignment of the function result with termination of function
    execution seems to me a code smell.

    I sense you may have the Algol 68 structure in mind (where all
    clauses just return the value that is _plainly stated_ without
    keyword); which is indeed very elegant for "normal" exits from
    functions. But we have to remember how "hard" (= ugly) it is
    to _early exit_ from functions there, needing an extra keyword,
    a special syntax rule, and a jump/label.

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Fri Oct 30 04:38:02 2026
    On 2026-10-30 00:56, Keith Thompson wrote:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    Note: my argumentation is based on questioning the existence of 'F'.
    So I'd appreciate to hear of any enlightening application cases, ones
    that would be impossible when 'F' in literals wouldn't be present.

    In C the word is constants, not literals.

    For now. In the latest C2y draft, they're called literals.

    Proposal: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3189.htm Draft standard: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3998.pdf

    (You've said before that you dislike this change.)

    In any case, the term "literal" is unambiguous, even if it's not
    currently used by the C standard.

    Thanks for answering him. (As I'm yet again ignoring him I wouldn't
    have noticed his statement.)

    For other readers I remind that I'm not necessarily using C-standard
    terms if there's terms common in CS existing that either appear more appropriately describing things, or if I'm generalizing facts beyond
    "C".

    It's noteworthy that the new C-standard draft is using that term;[*]
    I didn't know that, so also thanks also for that information.

    Janis

    [*] May we interpret that fact as C-standard terms might eventually
    converge to a more commonly accepted "beyond C standard" terminology?
    (I expect no answer. - It was just some pondering aloud.)


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 29 20:53:31 2026
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    On 2026-10-30 00:29, Keith Thompson wrote:
    [...]
    [...]
    In my personal coding style, I try to avoid making things that are
    not
    function calls look like function calls. In a function call, there's no
    space between the function name and the left parenthesis. [...]

    I suppose we should read the second sentence also as your "personal
    coding style".

    Yes, of course.

    In my personal coding style there's usually always a
    space.

    Then you're objectively wrong.

    (I kid, I kid!)

    [...]

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Fri Oct 30 05:01:20 2026
    On 2026-10-30 01:50, Lawrence D?Oliveiro wrote:
    [...]

    How would you do calculations involving compound interest payments
    without floating-point arithmetic? And why would you want to?

    Because what gets in and what comes out is just exact fixed point?
    And you need more an exact transformation to and from the internal
    values? And exact representation with BCD more than binary floating
    point? (Mind the 0.10 issue!) - I think there was a reason why with
    COBOL, the COmmon Business Oriented Language, there was - at least
    historically - fixed-point arithmetic used for the financial sector?
    (But please CMIIW.)

    Would there be a problem with fixed-point arithmetic (that internally
    uses a few more than just two decimals for rounding etc.) but that is
    using basically a fixed-point representation?

    And we saw in some post this hilarious sample of an (Amazon?) bill.
    (Not that this couldn't have been fixed even/also with FP-arithmetic.)

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Fri Oct 30 05:06:34 2026
    On 2026-10-30 04:53, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    In my personal coding style there's usually always a space.

    Then you're objectively wrong.

    (I kid, I kid!)

    *phew!*

    Oh, please, mind my heart - for a moment it stopped beating!

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 29 21:17:13 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> writes:
    [...]
    How would you do calculations involving compound interest payments
    without floating-point arithmetic?

    Because you'd want to follow the standards for financial calculations,
    which are likely to require some kind of fixed-point.

    And why would you want to?

    To obtain the exact results required by the relevant financial
    regulations, and to avoid accusations of malfeasance.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Oct 30 09:11:50 2026
    On 30/10/2026 04:38, Janis Papanagnou wrote:
    On 2026-10-30 00:56, Keith Thompson wrote:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    Note: my argumentation is based on questioning the existence of 'F'.
    So I'd appreciate to hear of any enlightening application cases, ones
    that would be impossible when 'F' in literals wouldn't be present.

    In C the word is constants, not literals.

    For now.˙ In the latest C2y draft, they're called literals.

    Proposal:˙˙˙˙˙˙ https://www.open-std.org/jtc1/sc22/wg14/www/docs/
    n3189.htm
    Draft standard: https://www.open-std.org/jtc1/sc22/wg14/www/docs/
    n3998.pdf

    (You've said before that you dislike this change.)

    In any case, the term "literal" is unambiguous, even if it's not
    currently used by the C standard.

    Thanks for answering him. (As I'm yet again ignoring him I wouldn't
    have noticed his statement.)

    For other readers I remind that I'm not necessarily using C-standard
    terms if there's terms common in CS existing that either appear more appropriately describing things, or if I'm generalizing facts beyond
    "C".

    The preference should be to use the C standard terms in this group - or
    to add brief comments for clarity. (Sometimes it is also worth adding comments for clarity even when using C standard terms.) The C standard
    uses terms like "object" and "byte" in a way that is unusual in the
    wider scope of computer science. But sometimes computer science courses
    use different terms, as do different programming languages and different
    parts of the world, and things change over time - often there is no
    single "standard CS" term, and often there is no fixed definition of a
    term commonly used in computer science. Many of the terms used in the C standard have the strong advantage of having specific definitions given
    in the standard itself.

    If in doubt, being a little extra explicit is better than being
    misunderstood!

    In the particular case of "constant", I think the root issue is that the
    word is overused. "integer constant" and "integer constant expression"
    are significantly different things in the C standards - it would seem
    logical to think that an "integer constant expression" evaluates to an "integer constant", but that is not the case. "const int x = 1;" does
    not define an "integer constant" or an "integer constant expression",
    while "constexpr int y = 1;" makes "y" and "integer constant expression"
    but not an "integer constant". Meanwhile, "Hello, world!" is a "string literal", not a "string constant".

    When C was young and fresh, there were far fewer constant things - and
    the terminology made sense. As more constant things (like "const" and
    then "constexpr") were added, it became less clear. C++ has called 123
    an "integer literal" for ages, and it makes sense for C to follow suit.

    I doubt if this is the start of a habit or pattern, however.



    It's noteworthy that the new C-standard draft is using that term;[*]
    I didn't know that, so also thanks also for that information.

    Janis

    [*] May we interpret that fact as C-standard terms might eventually
    converge to a more commonly accepted "beyond C standard" terminology?
    (I expect no answer. - It was just some pondering aloud.)



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Oct 30 09:33:52 2026
    On 30/10/2026 00:29, Keith Thompson wrote:
    cross@spitfire.i.gajendra.net (Dan Cross) writes:
    In article <11bvqbn$3g0tj$1@dont-email.me>,
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 2026-10-28 21:50, Steven G. Kargl wrote:
    On Wed, 28 Oct 2026 17:59:19 -0700, Tim Rentsch wrote:
    "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:
    On Wed, 28 Oct 2026 16:39:00 -0700, Keith Thompson wrote:
    (Also, you misspelled "ROFL", and you don't need parentheses on the >>>>>>> return statement, particularly if you dislike fluff.)

    Yeah, I was laugh too hard while typing ;-)

    Parentheses is a habit from BSD kernel source file style guide.

    Now is a good time to start unlearning that habit.

    Why? What harm do the parentheses cause?

    They can lead to people thinking that return is a function, even if they >>> nominally know better.

    What? This is an incredibly weak argument.

    If someone thought that `return` was a function, then why
    wouldn't they think that `if` or `while` were also functions?
    Or `sizeof`, and so on?

    I agree that it's a bit of a weak argument, but I wouldn't call it
    incredibly weak.

    In my personal coding style, I try to avoid making things that are not function calls look like function calls. In a function call, there's no space between the function name and the left parenthesis. I don't use
    that style for anything other than function calls (or invocations of function-like macros). Not because I don't know return and sizeof are keywords, but because it's just a little bit easier to read the code
    if distinctions like that are clear.

    Examples:

    func(42); // function call, or maybe a macro invocation
    return 42; // not return(42); or even "return (42);
    if (cond) // not if(cond)
    sizeof (int) // not sizeof(int)
    sizeof obj // not sizeof(obj) or sizeof (obj)


    My preferences are similar, except that rather than distinguishing
    between functions and non-functions, I distinguish between statements
    and non-statements. So I write "sizeof(int)", rather than having a
    space - I see the operator as being more akin to a function call or
    macro invocation than to a statement.

    (I also write "sizeof(obj)", as that appears more natural to me than
    "sizeof obj", and more consistent - I do not like having the parentheses depend on whether the operand is a type or an expression.)

    The idea is to make the code just a little bit clearer and easier to
    read. If I see something that looks it would be a function call except
    that the prefix is a keyword, it's *very slightly* annoying.
    Parentheses on a return statement are allowed, but they're part of the expression, not part of the syntax of the return statement, and they're superfluous. I don't write `return (42);` for the same reason I don't
    write `x = (42);`.

    When you have a coding style that you have used consistently for a long
    time, code written in a different style always looks a bit clumsy and
    ugly, and is inevitably at least marginally harder to read. Some people
    do put spaces in weird places in their code, such as "if( x ){ ... }",
    or they don't use spaces at all, or apparently randomly add long runs of spaces. There's no accounting for taste!


    And of course *all* of these rules can be overridden by a coding
    standard or by the existing style of the surrounding code.

    Indeed.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From chine.bleu@3:633/10 to All on Fri Oct 30 02:39:20 2026
    Janis Papanagnou wrote:
    Would there be a problem with fixed-point arithmetic (that internally
    uses a few more than just two decimals for rounding etc.) but that is
    using basically a fixed-point representation?
    You could make a library for rational numbers (two integers) arithmetic
    where the denominator is a power of ten. If the CPU has decimal
    arithmetic, implement it in assembly.

    --
    Siri Seal of Disavowal #777-000. Disavowed. Denied. @
    NO KINGS For I desire mercy not sacrifice. /|\
    The Church of the Holey Apple .signature 5.5 / \
    of Discordian Mysteries. This post insults Islam. Mohamed

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Fri Oct 30 11:58:05 2026
    On Wed, 28 Oct 2026 16:05:06 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:
    On Wed, 28 Oct 2026 14:26:05 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    David Brown <david.brown@hesbynett.no> writes:
    [...]
    I use the "f" suffix all the time in my code, because I do not
    want double precision. In many situations, single precision
    arithmetic is at least twice as fast as double precision - in
    some situations it can be two orders of magnitude faster.

    If you define objects as type float rather than double, do you have
    examples of code where using 0.1f rather than 0.1 makes a
    difference?

    One simple example: These two declarations result in identical code
    using gcc:

    float f = 0.1f;
    float f = 0.1;

    David almost certainly was talking about use of 0.1f in arithmetic expressions rather than in simple initialization.

    Agreed -- and I asked him for examples. (And no, didn't mean to
    suggest that there are no such examples.)

    And now that I've thought about it a bit more, here's a possible
    example:

    float f = rand(); // prevent optimization
    f *= 0.1;
    // f *= 0.1f;

    With 0.1, f is promoted to double before being multiplied by 0.1, and
    the result is converted to float. With 0.1f, double is not involved.
    And in the generated x86_64 assembly from gcc, I see cvtss2sd and
    cvtsd2ss when I use 0.1 that don't appear when I use 0.1f.

    Both expressions *might* yield the same result (and do in the small
    handful of cases I've checked), but it would take more analysis
    than I'm willing to perform to prove it in all cases.


    Since we're talking about single precision, analysis is not necessary.
    Any hypothesis can be easily tested by exhausting.
    In case of (float)(f * 0.1) == f * 0.1f, it fails for almost exactly one
    fifth of the numbers, including 1.00000011920928955f - the next float
    after 1.0f.


    I was too quick to assume that if a compiler sees 0.1 in an expression involving float operands, it can safely treat it as 0.1f. Since 0.1
    causes the usual arithmetic conversions to convert the other operand
    from float to double, I was very probably wrong.

    I can still imagine a compiler optimizing `f *= 0.1;` to use
    float arithmetic. I wonder if there are more clear-cut examples.


    I don't know what exactly is allowed by the Standard (that is, I know
    what's written, I don't know how peoples with lowyers attitude can
    interpret it), but will be extremely surprised if any "major" compiler
    is doing such optimization on IEEE-754 compliant platform in absence of non-compliance flags like fast-math.

    I'm assuming that FLT_EVAL_METHOD==0, meaning that float expressions
    are evaluated as float. If FLT_EVAL_METHOD==1, float expressions
    are evaluated to the range and precision of type double.




    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Oct 30 11:06:51 2026
    On 30/10/2026 10:39, chine.bleu wrote:
    Janis Papanagnou wrote:
    Would there be a problem with fixed-point arithmetic (that internally
    uses a few more than just two decimals for rounding etc.) but that is
    using basically a fixed-point representation?
    You could make a library for rational numbers (two integers) arithmetic where the denominator is a power of ten. If the CPU has decimal
    arithmetic, implement it in assembly.


    It does not make much sense to talk about a library for rational
    numbers, then restrict it to denominators with powers of ten. When you
    need exactly reproducible decimals, one option is to use a fixed number
    of places and then used scaled integers (a.k.a. fixed-point arithmetic)
    - basically hold your values in "long long int" types with a constant
    scale factor of 1'000'000, or similar.

    If you want to be able to handle different scale factors easily, then
    decimal floating point formats are appropriate. These are standardised
    in ISO/IEC 60559, and supported in C as _Decimal32, _Decimal64 and _Decimal128. The types are optional in C, but supported at least by gcc
    on "big" target systems. If the target hardware has appropriate
    instructions for them, the compiler should use that - that is vastly
    better than using assembly.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Fri Oct 30 10:58:35 2026
    In article <11c0kst$3pmvb$2@kst.eternal-september.org>,
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: >cross@spitfire.i.gajendra.net (Dan Cross) writes:
    In article <11bvqbn$3g0tj$1@dont-email.me>,
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    [snip]
    They can lead to people thinking that return is a function, even if they >>>nominally know better.

    What? This is an incredibly weak argument.

    If someone thought that `return` was a function, then why
    wouldn't they think that `if` or `while` were also functions?
    Or `sizeof`, and so on?

    I agree that it's a bit of a weak argument, but I wouldn't call it
    incredibly weak.

    In my personal coding style, I try to avoid making things that are not >function calls look like function calls. In a function call, there's no >space between the function name and the left parenthesis. I don't use
    that style for anything other than function calls (or invocations of >function-like macros). Not because I don't know return and sizeof are >keywords, but because it's just a little bit easier to read the code
    if distinctions like that are clear.
    [snip examples]

    If I may paraphrase your argument, it's that you like to omit
    parentheses where unnecessary, or otherwise make operators
    visually distinct from function calls, so that while scanning
    code they stand out.

    But that is qualitatively different than what Kuyper said: "They
    can lead to people thinking that return is a function", which is
    ridiculous. Anyone even passingly familiar with the language
    knows that `return` in C is not a function, parentheses or no.

    [snip]
    The premise (at least for me) is not that someone would *think*
    that return is a function, but that making a return statement not
    look too much like a function call makes the code just a little
    bit easier to read.

    Perhaps; perhaps not. My day job involes working on a variant
    of System V Unix, which has a very strict style guide similar to
    (but different from...) FreeBSD's. That guide is descended from
    a document Bill Shannon put together at Sun for code in the
    older, BSD-derived SunOS 4.x operating system; a few years ago,
    another engineer and I took that document, cleaned it up,
    updated it to reflect existing practice, reorganized it a bit
    to logically flow better, and published it as a man page: https://illumos.org/man/7/style

    There are many things in there that I do not personally like;
    mandatory parentheses around the expression in a `return` are
    among them, but also the outright ban on `//` comments, macros
    over inline functions, and so on. I hold my nose and follow it
    because that's a requirement of the job. *Shrug*

    But sometimes I am very surprised at what my colleagues find
    unreadable; recently I wrote a rather large driver for an IP in
    our SoC complexes, and among the things that driver does are
    allocating physical address space to MMIO. The internal
    function one calls to do such things takes a number of
    arguments, including a pointer to an attributes structure, an
    address, a size, flags, and so on. I had neatly grouped the
    arguments onto lines so that, for example, the pointer to the
    attributes structure was on one line, then a line break and then
    the address and size together by themselves on the next line,
    etc. The reviewer (who's been working in this source base for
    several decades) found that very difficult to read and asked me
    to fill the lines as much as I could, up to the 80-column
    maximum (another limit I find silly); ironically, I found that
    much more difficult to read.

    The point is, "readability" can be subjective. What one person
    finds easy to read may not be so for another.

    And in the example that started this subthread, I probably wouldn't
    have mentioned the parentheses if the poster hadn't been complaining
    about "fluff".

    Yeah, that's fair. The poster seems unnecessarily combative in
    a weird way.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Fri Oct 30 14:07:38 2026
    On 2026-10-30 10:39, chine.bleu wrote:

    You could make a library for rational numbers (two integers) arithmetic where the denominator is a power of ten.

    Using rational numbers is of course an option. Though I don't recall
    to have seen common systems with support of rational arithmetic, and
    also languages with a rational numbers type seem not be too common. (Incidentally I've not long ago written such for a language that while inherently supporting even 'complex' numbers there's no 'rational'.
    Rationals are no biggie so could easily be provided through a library.)
    But I also think the fixed point approach is still just simpler and
    that's probably the reason for often having been used.

    If the CPU has decimal arithmetic, implement it in assembly.

    Well, the pocket calculators often had that and did exactly that.

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Fri Oct 30 14:54:43 2026
    On 2026-10-30 09:11, David Brown wrote:
    On 30/10/2026 04:38, Janis Papanagnou wrote:
    On 2026-10-30 00:56, Keith Thompson wrote:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    Note: my argumentation is based on questioning the existence of 'F'. >>>>> So I'd appreciate to hear of any enlightening application cases, ones >>>>> that would be impossible when 'F' in literals wouldn't be present.

    In C the word is constants, not literals.

    For now.˙ In the latest C2y draft, they're called literals.

    Proposal:˙˙˙˙˙˙ https://www.open-std.org/jtc1/sc22/wg14/www/docs/
    n3189.htm
    Draft standard: https://www.open-std.org/jtc1/sc22/wg14/www/docs/
    n3998.pdf

    (You've said before that you dislike this change.)

    In any case, the term "literal" is unambiguous, even if it's not
    currently used by the C standard.

    Thanks for answering him. (As I'm yet again ignoring him I wouldn't
    have noticed his statement.)

    For other readers I remind that I'm not necessarily using C-standard
    terms if there's terms common in CS existing that either appear more
    appropriately describing things, or if I'm generalizing facts beyond
    "C".

    The preference should be to use the C standard terms in this group - or

    Like there's no CLC coding style (as recently demanded and rebutted)
    it's also, IMO, presumptuous to demand posters to use terms defined
    in the C-standards documents. Moreover, as I recently learned, even
    the standard-C documents seem to adjust their terminology.

    As I explained already, I'm using the terms that appear to me to be
    most appropriate to describe things. In cases where there's multiple
    options I'm gladly using the terms preferred in the C-standard docs,
    given that I know them.

    I certainly consider it presumptuous to demand from posters to read
    (all or every new version of) the C-standard to talk about "C".

    to add brief comments for clarity.˙ (Sometimes it is also worth adding comments for clarity even when using C standard terms.)˙ The C standard
    uses terms like "object" and "byte" in a way that is unusual in the
    wider scope of computer science.˙ But sometimes computer science courses
    use different terms, as do different programming languages and different parts of the world, and things change over time - often there is no
    single "standard CS" term, and often there is no fixed definition of a
    term commonly used in computer science.

    That's all correct.

    As I mentioned elsewhere already - I think also in a reply to a post
    of yours, about the same topic - I'm gladly explaining (if necessary)
    not only every word in my posts that are unclear to you but also the
    implied semantics if necessary.

    (Mind that, as opposed to you and some others, while you may do that,
    I'm *not* discussing the _C-standard_ here. You should make yourself
    clear that there's a difference between talking about all aspects of
    the language or exchange specifically about the formal aspects of "C".
    What makes perfectly sense for the former group is, to say the least,
    arguable for the general, non-specialized disputants.)

    Many of the terms used in the C
    standard have the strong advantage of having specific definitions given
    in the standard itself.

    Fine.


    If in doubt, being a little extra explicit is better than being misunderstood!

    No doubt.


    In the particular case of "constant", I think the root issue is that the word is overused.˙ "integer constant" and "integer constant expression"

    I think in the post you are referring to I described a different thing;
    I spoke about a constant literal. And the (IMO unnecessary) dispute had
    been about "literal" not about "constant". - And we heard that "literal"
    is even the new term used in the (draft) C-standard!

    [snip digressions about "integer constant" and "constant expressions"]
    [snip more digressions on early C-"constants"]

    [...]˙ C++ has called 123
    an "integer literal" for ages, and it makes sense for C to follow suit.

    Yes, and I agree with that choice. (I'm using the word "literal" for all programming languages if I want to talk about literals.)


    I doubt if this is the start of a habit or pattern, however.

    I think it's pointless to make guesses. (I'm certainly continuing to
    use those terms that I think are best fitting. And if you (or others)
    have problems understanding them I'm gladly explaining them, as said. Especially since I think the time spent on an explanation of a good
    term is much better spent than the time wasted for a discussion like
    the one you restarted here yet another time.)

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Fri Oct 30 13:55:09 2026
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    On 2026-10-30 01:50, Lawrence D?Oliveiro wrote:
    [...]

    How would you do calculations involving compound interest payments
    without floating-point arithmetic? And why would you want to?

    Because what gets in and what comes out is just exact fixed point?
    And you need more an exact transformation to and from the internal
    values? And exact representation with BCD more than binary floating
    point? (Mind the 0.10 issue!) - I think there was a reason why with
    COBOL, the COmmon Business Oriented Language, there was - at least >historically - fixed-point arithmetic used for the financial sector?
    (But please CMIIW.)

    All the early electrodata/burroughs business computers (Datatron 220,
    Burroughs B300, Burroughs B3500) used fixed point BCD representations
    for business applications and the COBOL compiler.


    Would there be a problem with fixed-point arithmetic (that internally
    uses a few more than just two decimals for rounding etc.) but that is
    using basically a fixed-point representation?

    And we saw in some post this hilarious sample of an (Amazon?) bill.
    (Not that this couldn't have been fixed even/also with FP-arithmetic.)

    Simply using %8.2f would have been sufficient, but modern programmers
    don't like printf formatting, apparently.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Oct 30 15:25:33 2026
    On 30/10/2026 14:54, Janis Papanagnou wrote:
    On 2026-10-30 09:11, David Brown wrote:
    On 30/10/2026 04:38, Janis Papanagnou wrote:
    On 2026-10-30 00:56, Keith Thompson wrote:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    Note: my argumentation is based on questioning the existence of 'F'. >>>>>> So I'd appreciate to hear of any enlightening application cases, ones >>>>>> that would be impossible when 'F' in literals wouldn't be present.

    In C the word is constants, not literals.

    For now.˙ In the latest C2y draft, they're called literals.

    Proposal:˙˙˙˙˙˙ https://www.open-std.org/jtc1/sc22/wg14/www/docs/
    n3189.htm
    Draft standard: https://www.open-std.org/jtc1/sc22/wg14/www/docs/
    n3998.pdf

    (You've said before that you dislike this change.)

    In any case, the term "literal" is unambiguous, even if it's not
    currently used by the C standard.

    Thanks for answering him. (As I'm yet again ignoring him I wouldn't
    have noticed his statement.)

    For other readers I remind that I'm not necessarily using C-standard
    terms if there's terms common in CS existing that either appear more
    appropriately describing things, or if I'm generalizing facts beyond
    "C".

    The preference should be to use the C standard terms in this group - or

    Like there's no CLC coding style (as recently demanded and rebutted)

    Agreed.

    it's also, IMO, presumptuous to demand posters to use terms defined
    in the C-standards documents.

    "Demand" is far too strong a word. It is not presumptuous or onerous to /prefer/ standard terms for a given language in a language-specific
    Usenet group. Discussing what is and is not supported and required by
    the C standards is par for the course in comp.lang.c, and understanding
    the standard terms is an important part of that. We don't need to be obsessive about it unless it is an important detail of the issue being discussed, as long things are clear enough.

    Moreover, as I recently learned, even
    the standard-C documents seem to adjust their terminology.

    This has happened /once/, in the space of about 40 years. It's not as
    if they change terms on a regular basis!


    As I explained already, I'm using the terms that appear to me to be
    most appropriate to describe things. In cases where there's multiple
    options I'm gladly using the terms preferred in the C-standard docs,
    given that I know them.

    Fair enough. The important thing, as I see it, is that people in a
    discussion know what each other is talking about.


    I certainly consider it presumptuous to demand from posters to read
    (all or every new version of) the C-standard to talk about "C".

    I would certainly agree on that, and I don't think anyone has made such demands.


    to add brief comments for clarity.˙ (Sometimes it is also worth adding
    comments for clarity even when using C standard terms.)˙ The C
    standard uses terms like "object" and "byte" in a way that is unusual
    in the wider scope of computer science.˙ But sometimes computer
    science courses use different terms, as do different programming
    languages and different parts of the world, and things change over
    time - often there is no single "standard CS" term, and often there is
    no fixed definition of a term commonly used in computer science.

    That's all correct.

    As I mentioned elsewhere already - I think also in a reply to a post
    of yours, about the same topic - I'm gladly explaining (if necessary)
    not only every word in my posts that are unclear to you but also the
    implied semantics if necessary.

    You tend to write very clearly - it's a rarity that your posts are misunderstood, I think.


    (Mind that, as opposed to you and some others, while you may do that,
    I'm *not* discussing the _C-standard_ here. You should make yourself
    clear that there's a difference between talking about all aspects of
    the language or exchange specifically about the formal aspects of "C".
    What makes perfectly sense for the former group is, to say the least, arguable for the general, non-specialized disputants.)

    It is certainly the case that there are times when detailed
    consideration of the exact language and terms of the standards are
    important to the discussion, and plenty of times when they are not. I
    have nothing against loser language when loser language is easier to use
    for the point at hand.


    Many of the terms used in the C standard have the strong advantage of
    having specific definitions given in the standard itself.

    Fine.


    If in doubt, being a little extra explicit is better than being
    misunderstood!

    No doubt.


    In the particular case of "constant", I think the root issue is that
    the word is overused.˙ "integer constant" and "integer constant
    expression"

    I think in the post you are referring to I described a different thing;
    I spoke about a constant literal. And the (IMO unnecessary) dispute had
    been about "literal" not about "constant". - And we heard that "literal"
    is even the new term used in the (draft) C-standard!


    I am not sure if I was referring to a particular post - and I am not
    sure if there was a "dispute" at all (unless you count Tim's post).
    It's okay for someone to comment on the term used in the C standard
    without it implying that your post was wrong to use a different term.

    In this particular case, I personally prefer "literal" to "constant".
    It's the term used in the C2y draft, it is also used in the C++
    standards, and consistent with current C standards use of "string
    literals" and "compound literals". But it can also be useful for people
    to know that "integer constant" is the term for 123 in current C, not
    "integer literal". One use of that knowledge is if people want to look
    up more information on quality reference sites (like cppreference.com)
    or in the standards themselves - it's easier if you know the standard
    terms. If you want to know the exact rules for "integer constants", and
    try to search the standards for "integer literal", you'll find no hits
    except, bizarrely, a mention of "binary integer literals" in the list of changes to standards versions.

    [snip digressions about "integer constant" and "constant expressions"]
    [snip more digressions on early C-"constants"]

    [...]˙ C++ has called 123 an "integer literal" for ages, and it makes
    sense for C to follow suit.

    Yes, and I agree with that choice. (I'm using the word "literal" for all programming languages if I want to talk about literals.)


    I doubt if this is the start of a habit or pattern, however.

    I think it's pointless to make guesses. (I'm certainly continuing to
    use those terms that I think are best fitting. And if you (or others)
    have problems understanding them I'm gladly explaining them, as said. Especially since I think the time spent on an explanation of a good
    term is much better spent than the time wasted for a discussion like
    the one you restarted here yet another time.)

    Janis



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Fri Oct 30 14:45:03 2026
    In article <11c29cu$alhk$1@dont-email.me>,
    David Brown <david.brown@hesbynett.no> wrote:
    On 30/10/2026 14:54, Janis Papanagnou wrote:
    [snip]
    it's also, IMO, presumptuous to demand posters to use terms defined
    in the C-standards documents.

    "Demand" is far too strong a word. It is not presumptuous or onerous to >/prefer/ standard terms for a given language in a language-specific
    Usenet group. Discussing what is and is not supported and required by
    the C standards is par for the course in comp.lang.c, and understanding
    the standard terms is an important part of that. We don't need to be >obsessive about it unless it is an important detail of the issue being >discussed, as long things are clear enough.

    I agree with both of you: mutual understanding should be the
    goal, and while a preference for the language used in the
    standard is certainly fine, there are unfortunately several
    examples around here of the type of person who favors pedantic
    attention to detail over that kind understanding.

    My own view is that this is not useful, and actively harmful.
    It certainly does not paint those posters in a positive light,
    as they appear to be more concerned with the minutia of the
    standard's phrasing than they are with its content, and are
    wholy unconcerned with usefully conveying anything of substance
    to a reader. Fixation on minor details feels like an excuse to
    find fault with a poster, then used to refrain from deeper
    engagement with whatever point they are raising, even if it is
    well considered and thoughtful. That's not holding conversation
    to a standard of quality; it is simplistic and reductive.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From chine.bleu@3:633/10 to All on Fri Oct 30 07:45:59 2026
    scott@slp53.sl.home (Scott Lurndal) wrote:
    All the early electrodata/burroughs business computers (Datatron 220, Burroughs B300, Burroughs B3500) used fixed point BCD representations
    for business applications and the COBOL compiler.

    STAR-100 supported 65535 digit decimal.

    --
    Siri Seal of Disavowal #777-000. Disavowed. Denied. @
    NO KINGS For I desire mercy not sacrifice. /|\
    The Church of the Holey Apple .signature 5.5 / \
    of Discordian Mysteries. This post insults Islam. Mohamed

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 30 11:12:45 2026
    On 10/30/2026 3:06 AM, David Brown wrote:
    On 30/10/2026 10:39, chine.bleu wrote:
    Janis Papanagnou wrote:
    Would there be a problem with fixed-point arithmetic (that internally
    uses a few more than just two decimals for rounding etc.) but that is
    using basically a fixed-point representation?
    You could make a library for rational numbers (two integers)
    arithmetic where the denominator is a power of ten. If the CPU has
    decimal arithmetic, implement it in assembly.


    It does not make much sense to talk about a library for rational
    numbers, then restrict it to denominators with powers of ten.˙ When you
    need exactly reproducible decimals, one option is to use a fixed number
    of places and then used scaled integers (a.k.a. fixed-point arithmetic)
    - basically hold your values in "long long int" types with a constant
    scale factor of 1'000'000, or similar.

    If you want to be able to handle different scale factors easily, then decimal floating point formats are appropriate.˙ These are standardised
    in ISO/IEC 60559, and supported in C as _Decimal32, _Decimal64 and _Decimal128.˙ The types are optional in C, but supported at least by gcc
    on "big" target systems.˙ If the target hardware has appropriate instructions for them, the compiler should use that - that is vastly
    better than using assembly.


    Try to gain a rational that fits for a given precision for a target
    real? Convergents of continued fractions?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Fri Oct 30 12:02:33 2026
    David Brown <david.brown@hesbynett.no> writes:
    [...]
    It is certainly the case that there are times when detailed
    consideration of the exact language and terms of the standards are
    important to the discussion, and plenty of times when they are not. I
    have nothing against loser language when loser language is easier to
    use for the point at hand.
    [...]

    That sounded a lot harsher than you intended until I realized you had misspelled "looser".

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Oct 30 21:01:58 2026
    On 30/10/2026 20:02, Keith Thompson wrote:
    David Brown <david.brown@hesbynett.no> writes:
    [...]
    It is certainly the case that there are times when detailed
    consideration of the exact language and terms of the standards are
    important to the discussion, and plenty of times when they are not. I
    have nothing against loser language when loser language is easier to
    use for the point at hand.
    [...]

    That sounded a lot harsher than you intended until I realized you had misspelled "looser".


    Oops - yes, it was a misspelling. Thanks for catching it, as I agree it sounded really bad! (My apologies to Janis if he felt I was somehow
    insulting him - it was not at all intentional.)

    Little red wiggles under misspelt words are great in general, but don't
    help much when the misspelling is also a valid word.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lynn McGuire@3:633/10 to All on Fri Oct 30 22:00:23 2026
    On 10/27/2026 5:53 AM, fir wrote:
    if ai generates me some functions it puts everywhere this f at the and
    yet it add zeros so instead of .1 i got 0.1f

    and i obviously dont like it

    i write hvever some codes when i need speed so the question is may it
    give some difference?

    i mean .1 maybe can be treated as doube constants so mabe occupies some
    more memory (?) or uses some casting in coplutations (?)


    i doubt it probably it makes difference but im strictly not sure

    Never give up precision easily. It will always come back to bite you.

    Lynn


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lynn McGuire@3:633/10 to All on Fri Oct 30 22:01:06 2026
    On 10/30/2026 10:00 PM, Lynn McGuire wrote:
    On 10/27/2026 5:53 AM, fir wrote:
    if ai generates me some functions it puts everywhere this f at the and
    yet it add zeros so instead of .1 i got 0.1f

    and i obviously dont like it

    i write hvever some codes when i need speed so the question is may it
    give some difference?

    i mean .1 maybe can be treated as doube constants so mabe occupies
    some more memory (?) or uses some casting in coplutations (?)


    i doubt it probably it makes difference but im strictly not sure

    Never give up precision easily.˙ It will always come back to bite you.

    Lynn

    Tell the AI to stop the nonsense.

    Lynn


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Paul@3:633/10 to All on Sat Oct 31 02:16:20 2026
    On Fri, 10/30/2026 11:01 PM, Lynn McGuire wrote:
    On 10/30/2026 10:00 PM, Lynn McGuire wrote:
    On 10/27/2026 5:53 AM, fir wrote:
    if ai generates me some functions it puts everywhere this f at the and
    yet it add zeros so instead of .1 i got 0.1f

    and i obviously dont like it

    i write hvever some codes when i need speed so the question is may it give some difference?

    i mean .1 maybe can be treated as doube constants so mabe occupies some more memory (?) or uses some casting in coplutations (?)


    i doubt it probably it makes difference but im strictly not sure

    Never give up precision easily.˙ It will always come back to bite you.

    Lynn

    Tell the AI to stop the nonsense.

    Lynn


    You can do that. The trick to being a vibe coder,
    is knowing what to put in the prompt.

    And this is why, even if you have "negative interest" in LLM-AI,
    you should at least do enough experiments to detect their dimensionality
    (their linear thinking when used in isolation and without
    a harness).

    There is a big big difference, between what Fir is doing,
    and what professionals right now are doing.

    [Teaser]

    https://www.theregister.com/devops/2026/09/18/microsoft-agentically-ports-copilot-runtime-to-rust-for-120k/5297549

    [Details]

    https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/

    On the one hand, the $120,000 worth of tokens, seems expensive. But
    on the other hand, the staff it would have taken to do the equivalent
    would not have been free.

    Even an expert, he still made a mistake in corralling the machines
    and preventing them from "cheating". The non-determinism means
    you can never stop learning about what guard statements to add.

    The code review is still the bottleneck, and lots of operations outside
    of Microsoft, do not see the gains of the "all-in" "experimental"
    approach shown in the above.

    Even if you're not interested in such things, you have to track
    the capabilities, to understand how your ass is going to get kicked.
    For example, you may have a superior product to the upstarts vibe-coding
    an equivalent. But now you are going to have to do extra marketing
    to ensure your existing customers "do not run away".

    The getcraft site has been making (what it claims are) equivalents
    to commercial applications like the Adobe suite and Microsoft Office.
    By no means are these equivalent, not even close. But what the
    existence of these things do, is they lead to customers "testing
    all sorts of shit" and diluting a lot of careful work you might
    have done to get where you are. I tested a couple of those getcraft in
    a VM, and there was "excessive CPU usage". The engine is Electron
    (for cross-platform usage).

    Paul



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From fir@3:633/10 to All on Sat Oct 31 08:30:32 2026
    Paul pisze:
    On Fri, 10/30/2026 11:01 PM, Lynn McGuire wrote:
    On 10/30/2026 10:00 PM, Lynn McGuire wrote:
    On 10/27/2026 5:53 AM, fir wrote:
    if ai generates me some functions it puts everywhere this f at the and >>>> yet it add zeros so instead of .1 i got 0.1f

    and i obviously dont like it

    i write hvever some codes when i need speed so the question is may it give some difference?

    i mean .1 maybe can be treated as doube constants so mabe occupies some more memory (?) or uses some casting in coplutations (?)


    i doubt it probably it makes difference but im strictly not sure

    Never give up precision easily.˙ It will always come back to bite you.

    Lynn

    Tell the AI to stop the nonsense.

    Lynn


    You can do that. The trick to being a vibe coder,
    is knowing what to put in the prompt.

    And this is why, even if you have "negative interest" in LLM-AI,
    you should at least do enough experiments to detect their dimensionality (their linear thinking when used in isolation and without
    a harness).

    There is a big big difference, between what Fir is doing,
    and what professionals right now are doing.

    [Teaser]

    https://www.theregister.com/devops/2026/09/18/microsoft-agentically-ports-copilot-runtime-to-rust-for-120k/5297549

    [Details]

    https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/

    On the one hand, the $120,000 worth of tokens, seems expensive. But
    on the other hand, the staff it would have taken to do the equivalent
    would not have been free.

    Even an expert, he still made a mistake in corralling the machines
    and preventing them from "cheating". The non-determinism means
    you can never stop learning about what guard statements to add.

    The code review is still the bottleneck, and lots of operations outside
    of Microsoft, do not see the gains of the "all-in" "experimental"
    approach shown in the above.

    Even if you're not interested in such things, you have to track
    the capabilities, to understand how your ass is going to get kicked.
    For example, you may have a superior product to the upstarts vibe-coding
    an equivalent. But now you are going to have to do extra marketing
    to ensure your existing customers "do not run away".

    The getcraft site has been making (what it claims are) equivalents
    to commercial applications like the Adobe suite and Microsoft Office.
    By no means are these equivalent, not even close. But what the
    existence of these things do, is they lead to customers "testing
    all sorts of shit" and diluting a lot of careful work you might
    have done to get where you are. I tested a couple of those getcraft in
    a VM, and there was "excessive CPU usage". The engine is Electron
    (for cross-platform usage).

    Paul

    i wouldnt say i do vibe coding..i do normal coding wit a help of ai assistant..vibe coding may be something different than i do

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Waldek Hebisch@3:633/10 to All on Sat Oct 31 12:18:21 2026
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    David Brown <david.brown@hesbynett.no> writes:
    On 28/10/2026 21:25, Michael S wrote:
    [...]
    I'd still likely prefer to write it as (float)0.1 instead of 0.1f.
    It somewhat depends on my mood in specific day, but likelihood is
    certainly not in favor of 0.1f.

    That seems a bit excessive to me, but okay. The principle is the
    same, making it clear to the reader and the compiler that no
    double-precision arithmetic is involved.

    Except that, at least in the abstract machine, `(float)0.1` produces
    a value of type double and converts it to float. It's likely that
    a compiler would generate the same code as for `0.1f`, but I'd want
    to confirm that if it mattered. (Actually, I'd just write `0.1f`.)

    Maybe the code will be the same. But in general going via doubles
    produces less accurate result, so `0.1f` "unquestionably"* better.

    * "unquestionably" in this group meaning that somebody will
    disagree.

    --
    Waldek Hebisch

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sat Oct 31 13:16:43 2026
    On 10/31/2026 12:30 AM, fir wrote:
    Paul pisze:
    On Fri, 10/30/2026 11:01 PM, Lynn McGuire wrote:
    On 10/30/2026 10:00 PM, Lynn McGuire wrote:
    On 10/27/2026 5:53 AM, fir wrote:
    if ai generates me some functions it puts everywhere this f at the and >>>>> yet it add zeros so instead of .1 i got 0.1f

    and i obviously dont like it

    i write hvever some codes when i need speed so the question is may
    it give some difference?

    i mean .1 maybe can be treated as doube constants so mabe occupies
    some more memory (?) or uses some casting in coplutations (?)


    i doubt it probably it makes difference but im strictly not sure

    Never give up precision easily.˙ It will always come back to bite you. >>>>
    Lynn

    Tell the AI to stop the nonsense.

    Lynn


    You can do that. The trick to being a vibe coder,
    is knowing what to put in the prompt.

    And this is why, even if you have "negative interest" in LLM-AI,
    you should at least do enough experiments to detect their dimensionality
    (their linear thinking when used in isolation and without
    a harness).

    There is a big big difference, between what Fir is doing,
    and what professionals right now are doing.

    ˙˙ [Teaser]

    ˙˙˙ https://www.theregister.com/devops/2026/09/18/microsoft-
    agentically-ports-copilot-runtime-to-rust-for-120k/5297549

    ˙˙ [Details]

    ˙˙˙ https://github.blog/ai-and-ml/generative-ai/migrating-the-github-
    copilot-runtime-to-rust-using-copilot/

    On the one hand, the $120,000 worth of tokens, seems expensive. But
    on the other hand, the staff it would have taken to do the equivalent
    would not have been free.

    Even an expert, he still made a mistake in corralling the machines
    and preventing them from "cheating". The non-determinism means
    you can never stop learning about what guard statements to add.

    The code review is still the bottleneck, and lots of operations outside
    of Microsoft, do not see the gains of the "all-in" "experimental"
    approach shown in the above.

    Even if you're not interested in such things, you have to track
    the capabilities, to understand how your ass is going to get kicked.
    For example, you may have a superior product to the upstarts vibe-coding
    an equivalent. But now you are going to have to do extra marketing
    to ensure your existing customers "do not run away".

    The getcraft site has been making (what it claims are) equivalents
    to commercial applications like the Adobe suite and Microsoft Office.
    By no means are these equivalent, not even close. But what the
    existence of these things do, is they lead to customers "testing
    all sorts of shit" and diluting a lot of careful work you might
    have done to get where you are. I tested a couple of those getcraft in
    a VM, and there was "excessive CPU usage". The engine is Electron
    (for cross-platform usage).

    ˙˙˙ Paul

    i wouldnt say i do˙ vibe coding..i do normal coding wit a help of ai assistant..vibe coding may be something different than i do

    At least you don't let do all of your coding.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From fir@3:633/10 to All on Sat Oct 31 21:23:30 2026
    Chris M. Thomasson pisze:
    On 10/31/2026 12:30 AM, fir wrote:
    Paul pisze:
    On Fri, 10/30/2026 11:01 PM, Lynn McGuire wrote:
    On 10/30/2026 10:00 PM, Lynn McGuire wrote:
    On 10/27/2026 5:53 AM, fir wrote:
    if ai generates me some functions it puts everywhere this f at the >>>>>> and
    yet it add zeros so instead of .1 i got 0.1f

    and i obviously dont like it

    i write hvever some codes when i need speed so the question is may >>>>>> it give some difference?

    i mean .1 maybe can be treated as doube constants so mabe occupies >>>>>> some more memory (?) or uses some casting in coplutations (?)


    i doubt it probably it makes difference but im strictly not sure

    Never give up precision easily.˙ It will always come back to bite you. >>>>>
    Lynn

    Tell the AI to stop the nonsense.

    Lynn


    You can do that. The trick to being a vibe coder,
    is knowing what to put in the prompt.

    And this is why, even if you have "negative interest" in LLM-AI,
    you should at least do enough experiments to detect their dimensionality >>> (their linear thinking when used in isolation and without
    a harness).

    There is a big big difference, between what Fir is doing,
    and what professionals right now are doing.

    ˙˙ [Teaser]

    ˙˙˙ https://www.theregister.com/devops/2026/09/18/microsoft-
    agentically-ports-copilot-runtime-to-rust-for-120k/5297549

    ˙˙ [Details]

    ˙˙˙ https://github.blog/ai-and-ml/generative-ai/migrating-the-github-
    copilot-runtime-to-rust-using-copilot/

    On the one hand, the $120,000 worth of tokens, seems expensive. But
    on the other hand, the staff it would have taken to do the equivalent
    would not have been free.

    Even an expert, he still made a mistake in corralling the machines
    and preventing them from "cheating". The non-determinism means
    you can never stop learning about what guard statements to add.

    The code review is still the bottleneck, and lots of operations outside
    of Microsoft, do not see the gains of the "all-in" "experimental"
    approach shown in the above.

    Even if you're not interested in such things, you have to track
    the capabilities, to understand how your ass is going to get kicked.
    For example, you may have a superior product to the upstarts vibe-coding >>> an equivalent. But now you are going to have to do extra marketing
    to ensure your existing customers "do not run away".

    The getcraft site has been making (what it claims are) equivalents
    to commercial applications like the Adobe suite and Microsoft Office.
    By no means are these equivalent, not even close. But what the
    existence of these things do, is they lead to customers "testing
    all sorts of shit" and diluting a lot of careful work you might
    have done to get where you are. I tested a couple of those getcraft in
    a VM, and there was "excessive CPU usage". The engine is Electron
    (for cross-platform usage).

    ˙˙˙ Paul

    i wouldnt say i do˙ vibe coding..i do normal coding wit a help of ai
    assistant..vibe coding may be something different than i do

    At least you don't let do all of your coding.

    this free model i use wouldnt be able to do that i think

    though sometimes i make an error giving it 20 small task instead of
    saying "do all that task"..im afraid of uveruse it..but its not good
    becouse of it i sometimes still dwell in boring editing work

    it is all very interesting thought, its really interesting 'adventure'


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Sun Nov 1 17:15:23 2026
    On 2026-10-29 17:55, Janis Papanagnou wrote:
    On 2026-10-29 20:49, Dan Cross wrote:
    [...]

    But again, the whole premise (that a programmer familiar with C>> would ever think that `return` is a function) is silly.

    Agreed. The misconception is far more common among those who aren't very familiar with C.
    Yes, that's hard to believe.

    See <https://stackoverflow.com/questions/2781244/is-return-an-operator-or-a-function>

    The following were all posted to comp.lang.c:

    On 1997-03-05, Raymond J Tompkins posted a message whose title was
    "Return() function, is it???" which starts out "I'm trying to use the
    return() function ...".

    On 2003-03-15, Ankur Vyas posted a message whose title was "return
    function".

    On 2010-08-28, Tony Clough wrote that
    "One possible problem with C as compared to other languages like Perl or
    Shell is that function calls require parentheses which leads to
    cluttered code. (But there are some funny exceptions in the standard
    library though, eg return and size_of do not need parentheses)"

    It's not, by any means, a common misconception, but it does occur.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sun Nov 1 23:29:33 2026
    On Sun, 1 Nov 2026 17:15:23 -0500, James Kuyper wrote:

    On 2010-08-28, Tony Clough wrote that "One possible problem with C
    as compared to other languages like Perl or Shell is that function
    calls require parentheses which leads to cluttered code. (But there
    are some funny exceptions in the standard library though, eg return
    and size_of do not need parentheses)"

    sizeof does require parentheses if you pass it a type, not for an
    expression (except for the usual precedence reasons).

    Not sure why that is ...

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Sun Nov 1 16:03:41 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> writes:
    On Sun, 1 Nov 2026 17:15:23 -0500, James Kuyper wrote:
    On 2010-08-28, Tony Clough wrote that "One possible problem with C
    as compared to other languages like Perl or Shell is that function
    calls require parentheses which leads to cluttered code. (But there
    are some funny exceptions in the standard library though, eg return
    and size_of do not need parentheses)"

    sizeof does require parentheses if you pass it a type, not for an
    expression (except for the usual precedence reasons).

    Not sure why that is ...

    Because if parentheses were not required around the type name, it would
    result in ambiguities. (I don't have an example off the top of my
    head.)

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Sun Nov 1 22:37:26 2026
    On 2026-10-30 05:58, Michael S wrote:
    On Wed, 28 Oct 2026 16:05:06 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    I was too quick to assume that if a compiler sees 0.1 in an expression
    involving float operands, it can safely treat it as 0.1f. Since 0.1
    causes the usual arithmetic conversions to convert the other operand
    from float to double, I was very probably wrong.

    I can still imagine a compiler optimizing `f *= 0.1;` to use
    float arithmetic. I wonder if there are more clear-cut examples.


    I don't know what exactly is allowed by the Standard (that is, I know
    what's written, I don't know how peoples with lowyers attitude can
    interpret it), ...
    "The accuracy of the floating-point operations (+, -, *, /) and of most
    of the library functions in <math.h> and <complex.h> that return
    floating-point results is implementation-defined, as is the accuracy of
    the conversion between floating-point internal representations and
    string representations performed by the library functions in <stdio.h>, <stdlib.h>, and <wchar.h>. The implementation may state that the
    accuracy is unknown." (n3998 5.3.5.33.p20)

    Note that this allows sufficient inaccuracy that the expression

    LDBL_MAX - LDBL_MIN < LDBL_MIN - LDBL_MAX

    is permitted to evaluate to 1, so long as you either document how bad
    the accuracy is, or state that it's unknown. Unless something else
    imposes stronger requirements, C floating point is almost completely
    useless.

    ... but will be extremely surprised if any "major" compiler
    is doing such optimization on IEEE-754 compliant platform in absence of non-compliance flags like fast-math.
    One way to get stronger requirements is to require that
    __STDC_IEC_60559_BFP__ be pre#defined, which mandates conformance with
    Annex F, which essentially requires conformance to ISO/IEC 60559 ==
    IEEE-754.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Mon Nov 2 08:50:17 2026
    On 02/11/2026 01:03, Keith Thompson wrote:
    Lawrence D?Oliveiro <ldo@nz.invalid> writes:
    On Sun, 1 Nov 2026 17:15:23 -0500, James Kuyper wrote:
    On 2010-08-28, Tony Clough wrote that "One possible problem with C
    as compared to other languages like Perl or Shell is that function
    calls require parentheses which leads to cluttered code. (But there
    are some funny exceptions in the standard library though, eg return
    and size_of do not need parentheses)"

    sizeof does require parentheses if you pass it a type, not for an
    expression (except for the usual precedence reasons).

    Not sure why that is ...

    Because if parentheses were not required around the type name, it would result in ambiguities. (I don't have an example off the top of my
    head.)


    Perhaps

    x = sizeof(int *) - 1
    vs
    x = sizeof int * - 1

    ?

    The later could certainly be misunderstood by someone reading it, but I
    don't know if it would have been ambiguous in the language if
    parentheses had not been required for "sizeof(type)".


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Mon Nov 2 18:22:23 2026
    Am 27.10.2026 um 18:50 schrieb fir:

    but the question is: can using .1 instead of 0.1f make me any harm in
    code? ...
    You might get a warning because of the precision loss.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Mon Nov 2 18:25:43 2026
    Am 27.10.2026 um 19:40 schrieb Scott Lurndal:

    Total
    75.71000000000001 USD

    Appears they may be using FP instead of integer fixed point arithmetic
    for pricing.

    If you have a proper fp to decimal runtime function this actually
    won't happen. That's while numbers which would result in the above
    output would always be rounded correctly. That's safe since you'd
    need billions of computations that wouldn't result to such results
    by accident.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Mon Nov 2 17:31:47 2026
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 27.10.2026 um 19:40 schrieb Scott Lurndal:

    Total
    75.71000000000001 USD

    Appears they may be using FP instead of integer fixed point arithmetic
    for pricing.

    If you have a proper fp to decimal runtime function this actually
    won't happen. That's while numbers which would result in the above
    output would always be rounded correctly. That's safe since you'd
    need billions of computations that wouldn't result to such results
    by accident.


    There's no reason to use FP at all in this application.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Nov 2 20:20:27 2026
    On Mon, 2 Nov 2026 18:25:43 +0100, Bonita Montero wrote:

    If you have a proper fp to decimal runtime function this actually
    won't happen.

    Or if you use a decimal rather than binary number representation in
    the first place.

    (Note this orthogonal to the issue of fixed-point versus
    floating-point.)

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Tue Nov 3 08:45:44 2026
    In article <11c8dls$2chr0$1@dont-email.me>,
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 2026-10-29 17:55, Janis Papanagnou wrote:
    On 2026-10-29 20:49, Dan Cross wrote:
    [...]

    But again, the whole premise (that a programmer familiar with C
    would ever think that `return` is a function) is silly.

    Agreed. The misconception is far more common among those
    who aren't very familiar with C.

    It is not common at all.

    Yes, that's hard to believe.

    See

    No. Cherry picking a few absurd examples from 20+ years of
    USENET, probably some of which are easily explained by
    non-native English speakers unxerstanding the construct but
    simply using the wrong nomenclature, really does not prove
    anything. You could probably find examples of new programmers
    being similarly confused by `while` and `if`, which I had
    mentioned previously.

    It's not, by any means, a common misconception, but it does occur.

    Not with any significant frequency or durability. To the extent
    that it ever happens, it is not the sort of error that survives
    even casual experience.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Kaz Kylheku@3:633/10 to All on Tue Nov 3 18:25:53 2026
    On 2026-11-03, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
    In article <11c8dls$2chr0$1@dont-email.me>,
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 2026-10-29 17:55, Janis Papanagnou wrote:
    On 2026-10-29 20:49, Dan Cross wrote:
    [...]

    But again, the whole premise (that a programmer familiar with C
    would ever think that `return` is a function) is silly.

    Agreed. The misconception is far more common among those
    who aren't very familiar with C.

    It is not common at all.

    You have to get to a certain advanced level of education in computer
    science before you start believing that returning is another function
    calls.

    But it's there. The returning control flow can be modeled by
    continuations.

    We can eliminate returns from a program by passing a context
    argument to each function: the return continuation. The places
    where the function returns become tail calls to the continuation.

    The transformation of a program to continuation passing style ("CPS transformation") can be done by a compiler, allowing a program in a
    language in which ordinary function returning appears to work under the
    hood by returns achieved by a function call.

    How it works is that all the code that would take place in the
    caller after a function returns is bundled into a lambda body,
    and the lambda is passed as the continuation argument.

    (This is now actually very familiar to youngsters who work in web front
    end and know about "async" functions. In that paradigm, a kind of
    continuation system appears whereby the computation we'd like to do from
    now on, but only after some event is received, is farmed out to a
    lambda.)

    Famously, (to tie this back to C somehow), Chicken Scheme implements continuation over the native stack in a particular way. Chicken Scheme
    code is translated to C code, and that C code never returns from its
    functions. It always passes a lambda to the callee. Lambdas capture
    their context on the stack. Because nothing ever returns, pointers and
    other objects on the stack nicely persist: local variables don't die
    after a function returns because it's compiled to a C function that
    returns by calling a continuation. When the stack hits a certain limit,
    it is rewound back to the top. At that time, all the objects in the
    stack that are still live are identified and moved to the heap. I think,
    even character strings in their entirety (the actual array) are
    bump-allocated on the stack, and so have to be memmoved to the heap when
    the stack rewinds, so the stack acts as a nursery for new objects.


    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Thu Nov 5 06:31:59 2026
    antispam@fricas.org (Waldek Hebisch) writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    David Brown <david.brown@hesbynett.no> writes:

    On 28/10/2026 21:25, Michael S wrote:

    [...]

    I'd still likely prefer to write it as (float)0.1 instead of 0.1f.
    It somewhat depends on my mood in specific day, but likelihood is
    certainly not in favor of 0.1f.

    That seems a bit excessive to me, but okay. The principle is the
    same, making it clear to the reader and the compiler that no
    double-precision arithmetic is involved.

    Except that, at least in the abstract machine, `(float)0.1` produces
    a value of type double and converts it to float. It's likely that
    a compiler would generate the same code as for `0.1f`, but I'd want
    to confirm that if it mattered. (Actually, I'd just write `0.1f`.)

    Maybe the code will be the same. But in general going via doubles
    produces less accurate result, [...]

    What makes you think using a double will produce a less accurate
    result?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Waldek Hebisch@3:633/10 to All on Thu Nov 5 22:07:10 2026
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
    antispam@fricas.org (Waldek Hebisch) writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    David Brown <david.brown@hesbynett.no> writes:

    On 28/10/2026 21:25, Michael S wrote:

    [...]

    I'd still likely prefer to write it as (float)0.1 instead of 0.1f.
    It somewhat depends on my mood in specific day, but likelihood is
    certainly not in favor of 0.1f.

    That seems a bit excessive to me, but okay. The principle is the
    same, making it clear to the reader and the compiler that no
    double-precision arithmetic is involved.

    Except that, at least in the abstract machine, `(float)0.1` produces
    a value of type double and converts it to float. It's likely that
    a compiler would generate the same code as for `0.1f`, but I'd want
    to confirm that if it mattered. (Actually, I'd just write `0.1f`.)

    Maybe the code will be the same. But in general going via doubles
    produces less accurate result, [...]

    What makes you think using a double will produce a less accurate
    result?

    Going via doubles number in the C source will be rounded twice,
    first time to a double, then the result of first runding will
    be rounded second time. Each rounding step introduces some
    error. Resonable heuristic says that errors may be close to
    maximal possible and may add. So error may be bigger than
    from single rounding.

    If you do not want to belive in the heuristic above, consider
    IEEE arthmetic and two consequtive single precisin numbers
    a and b. Next, take double c in the middle of the interval
    between a nad b. According to IEEE "round to even" rule this
    double will be rounded to one of the singles above, say a. Take
    source number d that rounds to c, but is on the side corresponding
    to b. Going via double will produce a as the result. Directly
    rounding to single will produce b. It is clear that b is
    closer to d than a, so double rounding in this case indeed
    produces more error, that is less accuracy.

    --
    Waldek Hebisch

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Fri Nov 6 12:03:34 2026
    In article <20261103101134.247@kylheku.com>,
    Kaz Kylheku <046-301-5902@kylheku.com> wrote:
    On 2026-11-03, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
    In article <11c8dls$2chr0$1@dont-email.me>,
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 2026-10-29 17:55, Janis Papanagnou wrote:
    On 2026-10-29 20:49, Dan Cross wrote:
    [...]

    But again, the whole premise (that a programmer familiar with C
    would ever think that `return` is a function) is silly.

    Agreed. The misconception is far more common among those
    who aren't very familiar with C.

    It is not common at all.

    You have to get to a certain advanced level of education in computer
    science before you start believing that returning is another function
    calls.

    But it's there. The returning control flow can be modeled by
    continuations.

    Sure. But you don't seriously believe that's what Kuyper was
    referring to, do you?

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Nov 6 19:23:33 2026
    On 10/29/2026 3:06 AM, David Brown wrote:
    On 28/10/2026 22:34, Chris M. Thomasson wrote:
    On 10/28/2026 12:39 AM, David Brown wrote:
    On 28/10/2026 01:49, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 18:06:25 -0400, James Kuyper wrote:

    However, if you need double precision, you shouldn't be using the
    "f" suffix.

    Is there any situation where you *should* use the ?f? suffix?

    I am thinking: no.

    Try thinking harder.

    I use the "f" suffix all the time in my code, because I do not want
    double precision.˙ In many situations, single precision arithmetic is
    at least twice as fast as double precision - in some situations it
    can be two orders of magnitude faster.



    Same here. I am mostly creating graphics related things. double
    precision in a GPU might not be there. Now, if I am doing something
    that needs higher precision, tends to be with deep zooms or
    granularity in a vector field, then double is okay. But I need to
    beware that the shaders might not support double.

    You can also see it in SIMD.˙ A 128-bit SIMD register might be useable
    for 4 single-precision values and parallel operations, while only 2 can
    be handled for double-precision.˙ Obviously details will vary by SIMD implementation, but singles are going to be at least twice as fast in general.


    Indeed....

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)