• Re: why is there not a ipow version of pow?

    From Lawrence D?Oliveiro@3:633/10 to All on Fri Aug 14 02:50:12 2026
    On Wed, 12 Aug 2026 18:40:37 +0200, Bonita Montero wrote:

    Nice fact: clang++ and g++ are *much* faster than MSVC with my code.
    I asked my self why is that and I had a look at the compiled code. I
    do a "b * e / b == b" check. MSVC uses a division for that. g++ and
    clang++ just check the overflow flag after doing the multiplication.

    Clever. :)

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Fri Aug 14 10:58:03 2026
    On 14/08/2026 8:07 AM, Lynn McGuire wrote:
    On 8/13/2026 4:19 AM, Johann 'Myrkraverk' Oskarsson wrote:
    On 11/08/2026 4:01 PM, Lynn McGuire wrote:
    Why is there not a ipow version of pow?

    ipow would return an int instead of a double.˙ Or a long long int.

    Thanks,
    Lynn


    Dear Lynn,

    I can't speak for the ISO C committee, but my guess is the lack of a
    multi precision library in the standard.˙ If I remember Tom St Denis'
    book correctly, implementing an ipow() with such a library is /trivial/
    for some version of trivial.˙ I just don't remember if such a function
    is included in his.

    In any case, I don't think an ipow() is all that useful unless there is
    a multiprecision type to return the value.˙ Do you disagree with that?

    I would rather see a standard user interface toolkit for C++ first.

    Fair enough. I come at this discussion from comp.lang.c, and as such,
    don't care what the C++ standards committee does.


    https://wxwidgets.org/ is close but I have yet to try it out.

    I just treat IUP as an /industry standard/ interface toolkit for C.

    https://iup.sourceforge.net/

    And I believe that would require a different standards committee than
    -- what was it? WG14 -- to include in the ISO standards collection, as
    it's still targetting C89 if I'm not mistaken, and doesn't keep up with
    WG14 at all.

    Perhaps just best to standardize it with A.N.S.I. in the United States,
    if at all? I admit ignorance on how much paperwork that is, and I'd
    certainly include PUC Rio in such discussions, somehow. Even if they're
    also not in the United States.


    Best wishes, and happy interfacing with IUP!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Fri Aug 14 11:22:25 2026
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: it?s
    all down to dynamic range. Logs and exponentials by their nature are
    liable to cover a huge range of magnitudes in either the argument
    (logarithm) or result (exponential). Integer formats in common use do
    not cater for this. Whereas with floating-point -- well, it?s there in
    the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe even a
    128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the
    one by the late Tom St Denis, in your code base?
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- 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 Aug 14 00:58:49 2026
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where chemicals are
    moving between the four phases of matter that we support: vapor,
    hydrocarbon liquid, aqueous liquid, and solids, based on temperature
    and pressure.˙ The tables are incredibly non-linear.

    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.

    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 Aug 14 01:00:40 2026
    On 8/13/2026 10:22 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: it?s
    all down to dynamic range. Logs and exponentials by their nature are
    liable to cover a huge range of magnitudes in either the argument
    (logarithm) or result (exponential). Integer formats in common use do
    not cater for this. Whereas with floating-point -- well, it?s there in
    the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe even a
    128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the
    one by the late Tom St Denis, in your code base?

    I am converting from Fortran 77 to C++. The last thing I want to do is introduce more new features in the code.

    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 Aug 14 01:14:11 2026
    On 8/13/2026 9:58 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 14/08/2026 8:07 AM, Lynn McGuire wrote:
    On 8/13/2026 4:19 AM, Johann 'Myrkraverk' Oskarsson wrote:
    On 11/08/2026 4:01 PM, Lynn McGuire wrote:
    Why is there not a ipow version of pow?

    ipow would return an int instead of a double.˙ Or a long long int.

    Thanks,
    Lynn


    Dear Lynn,

    I can't speak for the ISO C committee, but my guess is the lack of a
    multi precision library in the standard.˙ If I remember Tom St Denis'
    book correctly, implementing an ipow() with such a library is /trivial/
    for some version of trivial.˙ I just don't remember if such a function
    is included in his.

    In any case, I don't think an ipow() is all that useful unless there is
    a multiprecision type to return the value.˙ Do you disagree with that?

    I would rather see a standard user interface toolkit for C++ first.

    Fair enough.˙ I come at this discussion from comp.lang.c, and as such,
    don't care what the C++ standards committee does.


    https://wxwidgets.org/ is close but I have yet to try it out.

    I just treat IUP as an /industry standard/ interface toolkit for C.

    ˙ https://iup.sourceforge.net/

    And I believe that would require a different standards committee than
    -- what was it? WG14 -- to include in the ISO standards collection, as
    it's still targetting C89 if I'm not mistaken, and doesn't keep up with
    WG14 at all.

    Perhaps just best to standardize it with A.N.S.I. in the United States,
    if at all?˙ I admit ignorance on how much paperwork that is, and I'd certainly include PUC Rio in such discussions, somehow.˙ Even if they're
    also not in the United States.


    Best wishes, and happy interfacing with IUP!

    Here is a couple of screenshots of our Windows User Interface using MFC
    and a dialog toolkit that I ported from our Smalltalk app a few decades ago:
    https://www.winsim.com/screenshots.html

    As you can see, we use a diagrammatic user interface very similar to
    Visio. Ours was written back in the Windows 1.0 days in the 1980s and significantly enhanced over the years. I would like to get Mac and
    Linux versions. And port to 64 bit as some of our simulation flowsheets
    are approaching 1 GB where we run out of memory at that point.

    I looked at IUP. Looks interesting.

    Thanks,
    Lynn


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Fri Aug 14 14:47:19 2026
    On 14/08/2026 2:00 PM, Lynn McGuire wrote:
    On 8/13/2026 10:22 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: it?s
    all down to dynamic range. Logs and exponentials by their nature are
    liable to cover a huge range of magnitudes in either the argument
    (logarithm) or result (exponential). Integer formats in common use do
    not cater for this. Whereas with floating-point -- well, it?s there in >>>> the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe even
    a 128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the
    one by the late Tom St Denis, in your code base?

    I am converting from Fortran 77 to C++.˙ The last thing I want to do is introduce more new features in the code.

    Lynn


    Fair enough. If you change your mind -- and for other people interested
    in the subject -- you can look at chapter seven of Tom's book. Of
    course, you won't need to read the details of the implementation just to
    use the library, which is available somewhere on GitHub.


    Have a nice day!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- 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 Aug 14 08:57:12 2026
    On 14/08/2026 01:59, Lynn McGuire wrote:
    On 8/13/2026 1:38 AM, David Brown wrote:
    On 12/08/2026 23:49, Lynn McGuire wrote:
    [...]
    I have found over the years that 200 points seems to be best when
    performing a numerical integration of a curve.˙ For me, 200 points is
    the point where diminishing returns has set in.˙ Of course, YMMV.


    Your mileage may very much vary.˙ The best number of points depends on
    many factors, such as the type of curve (how "wiggly" it is, whether
    it has additional characteristics like monoticity that you can use,
    etc.), whether you are using linearly separated points or free points,
    how your interpolation works, what characteristics you need for the
    generated results, your required precision, etc.˙ Characteristics of
    the target architecture can influence the best choice of points -
    bigger tables may let you use simpler calculations, but calculations
    may be cheaper than more complicated table lookup schemes.˙ There is
    no single guideline for the number of points in such tables that can
    be useful in any general sense.

    [...]

    Mine is coming from a chemical process simulator where chemicals are
    moving between the four phases of matter that we support: vapor,
    hydrocarbon liquid, aqueous liquid, and solids, based on temperature and pressure.˙ The tables are incredibly non-linear.


    Sure, for particularly "wiggly" curves, or paths with discontinuities,
    you need a lot more information to describe them - that means more
    points, or more complex interpolation between them. (I am using "interpolation" in a general sense here, including any kind of
    polynomial approximation - not specifically simple linear
    interpolation.) I have no doubt that you need more points than I need -
    there is no universal rule of thumb for table size that suits a range of applications.


    --- 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 Aug 14 13:54:54 2026
    On 8/14/2026 1:47 AM, Johann 'Myrkraverk' Oskarsson wrote:
    On 14/08/2026 2:00 PM, Lynn McGuire wrote:
    On 8/13/2026 10:22 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: it?s >>>>> all down to dynamic range. Logs and exponentials by their nature are >>>>> liable to cover a huge range of magnitudes in either the argument
    (logarithm) or result (exponential). Integer formats in common use do >>>>> not cater for this. Whereas with floating-point -- well, it?s there in >>>>> the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe even
    a 128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the
    one by the late Tom St Denis, in your code base?

    I am converting from Fortran 77 to C++.˙ The last thing I want to do
    is introduce more new features in the code.

    Lynn


    Fair enough.˙ If you change your mind -- and for other people interested
    in the subject -- you can look at chapter seven of Tom's book.˙ Of
    course, you won't need to read the details of the implementation just to
    use the library, which is available somewhere on GitHub.


    Have a nice day!

    BTW, in Smalltalk you can return any type of object from a method. But
    if the caller got a weird object back, it was a place of confusion and
    often a crash as the expected object type was not the actual object
    type. So, all objects had to have a common set of methods (read, write, print, add, etc) to keep weird crashes from happening. I ended up
    putting all methods at an object and the base object too. Our base
    object had hundreds of methods to handle weird cases.

    I way prefer strongly typed languages now. Stops a lot of crazy at
    runtime, also known as crashes.

    Lynn


    --- 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 Aug 14 12:03:07 2026
    On 8/13/2026 11:47 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 14/08/2026 2:00 PM, Lynn McGuire wrote:
    On 8/13/2026 10:22 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: it?s >>>>> all down to dynamic range. Logs and exponentials by their nature are >>>>> liable to cover a huge range of magnitudes in either the argument
    (logarithm) or result (exponential). Integer formats in common use do >>>>> not cater for this. Whereas with floating-point -- well, it?s there in >>>>> the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe even
    a 128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the
    one by the late Tom St Denis, in your code base?

    I am converting from Fortran 77 to C++.˙ The last thing I want to do
    is introduce more new features in the code.

    Lynn


    Fair enough.˙ If you change your mind -- and for other people interested
    in the subject -- you can look at chapter seven of Tom's book.˙ Of
    course, you won't need to read the details of the implementation just to
    use the library, which is available somewhere on GitHub.


    Have a nice day!

    The have a nice day, and the -- are tell tale signs of an AI writing
    your responses?

    --- 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 Aug 14 12:08:10 2026
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where chemicals are
    moving between the four phases of matter that we support: vapor,
    hydrocarbon liquid, aqueous liquid, and solids, based on temperature
    and pressure.˙ The tables are incredibly non-linear.

    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do some of
    them look fractal?

    --- 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 Aug 14 12:46:22 2026
    On 8/13/2026 11:57 PM, David Brown wrote:
    On 14/08/2026 01:59, Lynn McGuire wrote:
    On 8/13/2026 1:38 AM, David Brown wrote:
    On 12/08/2026 23:49, Lynn McGuire wrote:
    [...]
    I have found over the years that 200 points seems to be best when
    performing a numerical integration of a curve.˙ For me, 200 points
    is the point where diminishing returns has set in.˙ Of course, YMMV.


    Your mileage may very much vary.˙ The best number of points depends
    on many factors, such as the type of curve (how "wiggly" it is,
    whether it has additional characteristics like monoticity that you
    can use, etc.), whether you are using linearly separated points or
    free points, how your interpolation works, what characteristics you
    need for the generated results, your required precision, etc.
    Characteristics of the target architecture can influence the best
    choice of points - bigger tables may let you use simpler
    calculations, but calculations may be cheaper than more complicated
    table lookup schemes.˙ There is no single guideline for the number of
    points in such tables that can be useful in any general sense.

    [...]

    Mine is coming from a chemical process simulator where chemicals are
    moving between the four phases of matter that we support: vapor,
    hydrocarbon liquid, aqueous liquid, and solids, based on temperature
    and pressure.˙ The tables are incredibly non-linear.


    Sure, for particularly "wiggly" curves, or paths with discontinuities,
    you need a lot more information to describe them - that means more
    points, or more complex interpolation between them.˙ (I am using "interpolation" in a general sense here, including any kind of
    polynomial approximation - not specifically simple linear
    interpolation.)˙ I have no doubt that you need more points than I need - there is no universal rule of thumb for table size that suits a range of applications.


    Here is a fairly interesting interpolation... Fwiw, here is my driver
    code. I learned about this algo on a BASIC group. too funny! I ported it
    over to my system. It generates some frames for an animation:

    #pragma once


    #include "ct_multi_thread_field_final.hpp"
    #include "ct_cairo.hpp"
    #include "ct_complex.hpp"
    #include "ct_geometry.hpp"
    #include "ct_glm.hpp"

    #include <iostream>
    #include <vector>
    #include <cstdlib>
    #include <cstdio>
    #include <string>


    namespace ct {

    namespace swimmer {


    struct settings
    {
    float radius = 1;
    float t = 0;
    int n_points = 3000;
    float lw = 1;
    float sin_mul0 = 450;
    float sin_mul1 = 930;
    };

    void
    draw(
    ct::plot::cairo::plot_2d& plot,
    settings const& cfg
    ) {
    glm::vec2 prev(0.0f, 0.0f);

    for (int i = 0; i < cfg.n_points; ++i)
    {
    float a = (float)i / (cfg.n_points - 1);

    float at = 2 * a * CT_PI - 8 * cfg.t;
    float b = glm::sin(cfg.sin_mul0 * a) * (0.7f + glm::sin(cfg.sin_mul1 * a));

    float e = 2 * a * glm::exp(-a * 8);
    float l = 1.5f * (0.7f - a) * (1 - b * b / 8) + cfg.t;
    float w = e * b - glm::sin(at) / 12 + 0.75f;

    glm::vec2 p(w * glm::cos(l), w * glm::sin(l));
    p *= cfg.radius;

    if (i > 0)
    {
    int col = (int)(128 + 127 * glm::cos(4 * b - a * 6));
    unsigned char red = (unsigned char)glm::clamp(col,
    0, 255);
    unsigned char blue = (unsigned char)glm::clamp(255
    - col, 0, 255);

    ct::plot::cairo::pixel color = CT_RGB(red, 255, blue);
    plot.line(prev, p, color, cfg.lw);
    }

    prev = p;
    }
    }


    void
    draw_pinwheel(
    ct::plot::cairo::plot_2d& plot,
    float t,
    unsigned long n = 10
    ) {
    float normal_base = 1.f / (n - 1);

    for (unsigned long i = 0; i < n; ++i)
    {
    float normal = normal_base * i;

    float r = normal;
    float local_t = normal * n * 10 + t; // outer t
    offsets the whole formation

    draw(plot, { .radius = r, .t = local_t, .lw = 2 });
    }
    }


    void
    manifest_anime(
    ct::plot::cairo::plot_2d& scene,
    unsigned long fps,
    unsigned long duration
    ) {
    unsigned long frames = fps * duration;

    float normal_base = 1.f / frames;

    for (unsigned long i = 0; i < frames; ++i)
    {
    float normal = normal_base * i;
    float t = CT_PI2 * normal;

    scene.clear(CT_RGBF(0, 0, 0));

    draw_pinwheel(scene, t, 16);

    {
    std::string filename =
    "./ct_swimmer/frames/ct_frame_" + std::to_string(i) + ".png";

    std::cout << "filename = " << filename << "\n";
    std::cout << "normal = " << normal << "\n";
    std::cout << "t = " << t << std::endl;

    scene.save(filename.c_str());
    }
    }
    }

    void
    manifest(
    ct::plot::cairo::plot_2d& scene
    ) {
    std::cout << "ct::swimmer()\n";
    std::cout << "__________________________________\n" <<
    std::endl;

    {
    manifest_anime(scene, 24, 5);
    }

    {
    // draw_pinwheel(scene, 0.0f);
    // draw_pinwheel(scene, 0.5f);
    // draw_pinwheel(scene, 0.75f);
    // draw_pinwheel(scene, 1.f);
    // draw_pinwheel(scene, 2.f);
    //draw_pinwheel(scene, 3.f);


    }
    }
    }

    } // ct::swimmer




    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sat Aug 15 03:51:07 2026
    On 15/08/2026 3:03 AM, Chris M. Thomasson wrote:
    On 8/13/2026 11:47 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 14/08/2026 2:00 PM, Lynn McGuire wrote:
    On 8/13/2026 10:22 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: it?s >>>>>> all down to dynamic range. Logs and exponentials by their nature are >>>>>> liable to cover a huge range of magnitudes in either the argument
    (logarithm) or result (exponential). Integer formats in common use do >>>>>> not cater for this. Whereas with floating-point -- well, it?s
    there in
    the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe
    even a 128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the
    one by the late Tom St Denis, in your code base?

    I am converting from Fortran 77 to C++.˙ The last thing I want to do
    is introduce more new features in the code.

    Lynn


    Fair enough.˙ If you change your mind -- and for other people interested
    in the subject -- you can look at chapter seven of Tom's book.˙ Of
    course, you won't need to read the details of the implementation just to
    use the library, which is available somewhere on GitHub.


    Have a nice day!

    The have a nice day, and the -- are tell tale signs of an AI writing
    your responses?

    Is the expression /tell tale/ a sign of you insisting I use A.I. when
    you know I don't? Do you get off of writing tall tales? Do you post
    in alt.sex.erotica.moderated? Are you the moderator?

    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- 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 Aug 14 12:52:31 2026
    On 8/14/2026 12:51 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 15/08/2026 3:03 AM, Chris M. Thomasson wrote:
    On 8/13/2026 11:47 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 14/08/2026 2:00 PM, Lynn McGuire wrote:
    On 8/13/2026 10:22 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: it?s >>>>>>> all down to dynamic range. Logs and exponentials by their nature are >>>>>>> liable to cover a huge range of magnitudes in either the argument >>>>>>> (logarithm) or result (exponential). Integer formats in common
    use do
    not cater for this. Whereas with floating-point -- well, it?s
    there in
    the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe
    even a 128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the >>>>> one by the late Tom St Denis, in your code base?

    I am converting from Fortran 77 to C++.˙ The last thing I want to do
    is introduce more new features in the code.

    Lynn


    Fair enough.˙ If you change your mind -- and for other people interested >>> in the subject -- you can look at chapter seven of Tom's book.˙ Of
    course, you won't need to read the details of the implementation just to >>> use the library, which is available somewhere on GitHub.


    Have a nice day!

    The have a nice day, and the -- are tell tale signs of an AI writing
    your responses?

    Is the expression /tell tale/ a sign of you insisting I use A.I. when
    you know I don't?˙ Do you get off of writing tall tales?˙ Do you post
    in alt.sex.erotica.moderated?˙ Are you the moderator?


    Are you using AI to help write your responses? There are some flags.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sat Aug 15 04:01:14 2026
    On 15/08/2026 3:52 AM, Chris M. Thomasson wrote:
    On 8/14/2026 12:51 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 15/08/2026 3:03 AM, Chris M. Thomasson wrote:
    On 8/13/2026 11:47 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 14/08/2026 2:00 PM, Lynn McGuire wrote:
    On 8/13/2026 10:22 PM, Johann 'Myrkraverk' Oskarsson wrote:
    On 12/08/2026 2:37 PM, Lynn McGuire wrote:
    On 8/11/2026 11:26 PM, Lawrence D?Oliveiro wrote:
    On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:

    Why is there not a ipow version of pow?

    Perhaps for the same reason there aren?t integer log functions: >>>>>>>> it?s
    all down to dynamic range. Logs and exponentials by their nature >>>>>>>> are
    liable to cover a huge range of magnitudes in either the argument >>>>>>>> (logarithm) or result (exponential). Integer formats in common >>>>>>>> use do
    not cater for this. Whereas with floating-point -- well, it?s >>>>>>>> there in
    the name, isn?t it?

    This is why you calculate and return a long long int.˙ Or maybe >>>>>>> even a 128 bit int.

    Lynn


    Is there a reason you don't use a multiprecision library, such as the >>>>>> one by the late Tom St Denis, in your code base?

    I am converting from Fortran 77 to C++.˙ The last thing I want to
    do is introduce more new features in the code.

    Lynn


    Fair enough.˙ If you change your mind -- and for other people
    interested
    in the subject -- you can look at chapter seven of Tom's book.˙ Of
    course, you won't need to read the details of the implementation
    just to
    use the library, which is available somewhere on GitHub.


    Have a nice day!

    The have a nice day, and the -- are tell tale signs of an AI writing
    your responses?

    Is the expression /tell tale/ a sign of you insisting I use A.I. when
    you know I don't?˙ Do you get off of writing tall tales?˙ Do you post
    in alt.sex.erotica.moderated?˙ Are you the moderator?


    Are you using AI to help write your responses? There are some flags.

    You're completely free to capture the flag on your own. You'll just
    have to write the game in C, because I'm coming at this from comp.lang.
    c. And not comp.lang.c++.

    I still type my replies by hand, but you're unable to do so, so you must dictate to Siri, which sends the request to Copilot, which hopefully
    uses the most expensive Usenet service available for your posts. I
    mean, why stop at paying both the fruit vendor for Siri, and Microsoft
    for Copilot, and not get the world's best and greatest Usenet provider?


    Happy posting on Usenet with Siri and Copilot!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- 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 Aug 14 13:27:14 2026
    On 8/14/2026 1:01 PM, Johann 'Myrkraverk' Oskarsson wrote:
    [...]
    You're completely free to capture the flag on your own.˙ You'll just
    have to write the game in C, because I'm coming at this from comp.lang.
    c.˙ And not comp.lang.c++.

    I still type my replies by hand, but you're unable to do so, so you must dictate to Siri, which sends the request to Copilot, which hopefully
    uses the most expensive Usenet service available for your posts.˙ I
    mean, why stop at paying both the fruit vendor for Siri, and Microsoft
    for Copilot, and not get the world's best and greatest Usenet provider?


    Happy posting on Usenet with Siri and Copilot!

    Huh. So, you are an "ass" all by yourself?

    --- 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 Aug 14 13:29:13 2026
    On 8/14/2026 1:27 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:01 PM, Johann 'Myrkraverk' Oskarsson wrote:
    [...]
    You're completely free to capture the flag on your own.˙ You'll just
    have to write the game in C, because I'm coming at this from comp.lang.
    c.˙ And not comp.lang.c++.

    I still type my replies by hand, but you're unable to do so, so you must
    dictate to Siri, which sends the request to Copilot, which hopefully
    uses the most expensive Usenet service available for your posts.˙ I
    mean, why stop at paying both the fruit vendor for Siri, and Microsoft
    for Copilot, and not get the world's best and greatest Usenet provider?


    Happy posting on Usenet with Siri and Copilot!

    Huh. So, you are an "ass" all by yourself?

    The -- and the final "have a happy ..." aspects reek of AI all over...

    --- 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 Aug 14 15:48:55 2026
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where chemicals are
    moving between the four phases of matter that we support: vapor,
    hydrocarbon liquid, aqueous liquid, and solids, based on temperature
    and pressure.˙ The tables are incredibly non-linear.

    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do some of them look fractal?

    In short, no. We have a diagrammatic user interface that allows our
    users to build a diagram of a chemical process flow diagram such as a refinery, a natural gas plan, a pipeline with compressor stations, or a chemical plant.
    https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of that
    diagram and solves it thermodynamically. If, it can be solved as not
    all chemical processes can be solved due to constraints or violation of
    the laws of thermodynamics.

    Thanks,
    Lynn


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sat Aug 15 04:49:05 2026
    On 15/08/2026 4:29 AM, Chris M. Thomasson wrote:
    On 8/14/2026 1:27 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:01 PM, Johann 'Myrkraverk' Oskarsson wrote:
    [...]
    You're completely free to capture the flag on your own.˙ You'll just
    have to write the game in C, because I'm coming at this from comp.lang.
    c.˙ And not comp.lang.c++.

    I still type my replies by hand, but you're unable to do so, so you must >>> dictate to Siri, which sends the request to Copilot, which hopefully
    uses the most expensive Usenet service available for your posts.˙ I
    mean, why stop at paying both the fruit vendor for Siri, and Microsoft
    for Copilot, and not get the world's best and greatest Usenet provider?


    Happy posting on Usenet with Siri and Copilot!

    Huh. So, you are an "ass" all by yourself?

    The -- and the final "have a happy ..." aspects reek of AI all over...

    Ah, yes. You're still having problems with the distinction between
    fantasy and reality. I believe I've told you this before, and you
    didn't listen then, so I can only surmise you cannot handle the truth.

    I /write well/. I can write micro-fiction for my own amusement all day
    long. And since I have no interest in amusing you, you fucking asshole,
    I guess this is the last I'll ever say on this subject. I don't need to
    use L.L.M. The L.L.Ms. were trained on the best of us. I'm one.


    Deal with it, you fucking cuck!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- 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 Aug 14 13:51:43 2026
    On 8/14/2026 1:48 PM, Lynn McGuire wrote:
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where chemicals
    are moving between the four phases of matter that we support:
    vapor, hydrocarbon liquid, aqueous liquid, and solids, based on
    temperature and pressure.˙ The tables are incredibly non-linear.

    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do some
    of them look fractal?

    In short, no.˙ We have a diagrammatic user interface that allows our
    users to build a diagram of a chemical process flow diagram such as a refinery, a natural gas plan, a pipeline with compressor stations, or a chemical plant.
    ˙˙ https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of that diagram and solves it thermodynamically.˙ If, it can be solved as not
    all chemical processes can be solved due to constraints or violation of
    the laws of thermodynamics.
    Ahhhh! So, you are not making any animations of the processes. Okay. But
    you have the data to do so...

    Fwiw, I bet you already have the data to make one of my 2d examples here:

    https://youtu.be/YS-tyDJVy4M

    --- 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 Aug 14 16:40:26 2026
    On 8/14/2026 3:51 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:48 PM, Lynn McGuire wrote:
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where chemicals
    are moving between the four phases of matter that we support:
    vapor, hydrocarbon liquid, aqueous liquid, and solids, based on
    temperature and pressure.˙ The tables are incredibly non-linear.

    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do some
    of them look fractal?

    In short, no.˙ We have a diagrammatic user interface that allows our
    users to build a diagram of a chemical process flow diagram such as a
    refinery, a natural gas plan, a pipeline with compressor stations, or
    a chemical plant.
    ˙˙˙ https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of that
    diagram and solves it thermodynamically.˙ If, it can be solved as not
    all chemical processes can be solved due to constraints or violation
    of the laws of thermodynamics.
    Ahhhh! So, you are not making any animations of the processes. Okay. But
    you have the data to do so...

    Fwiw, I bet you already have the data to make one of my 2d examples here:

    https://youtu.be/YS-tyDJVy4M

    Actually, I do make an animation of the process simulation diagram
    (PSD). If the users run a dynamic (time sensitive) version of the
    simulation, the user can roll through their displayed results on the
    various sheets of the PSD using their time breaks.

    Lynn


    --- 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 Aug 14 19:24:28 2026
    On 8/14/2026 2:40 PM, Lynn McGuire wrote:
    On 8/14/2026 3:51 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:48 PM, Lynn McGuire wrote:
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where chemicals >>>>>>> are moving between the four phases of matter that we support:
    vapor, hydrocarbon liquid, aqueous liquid, and solids, based on >>>>>>> temperature and pressure.˙ The tables are incredibly non-linear. >>>>>>>
    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do
    some of them look fractal?

    In short, no.˙ We have a diagrammatic user interface that allows our
    users to build a diagram of a chemical process flow diagram such as a
    refinery, a natural gas plan, a pipeline with compressor stations, or
    a chemical plant.
    ˙˙˙ https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of that
    diagram and solves it thermodynamically.˙ If, it can be solved as not
    all chemical processes can be solved due to constraints or violation
    of the laws of thermodynamics.
    Ahhhh! So, you are not making any animations of the processes. Okay.
    But you have the data to do so...

    Fwiw, I bet you already have the data to make one of my 2d examples here:

    https://youtu.be/YS-tyDJVy4M

    Actually, I do make an animation of the process simulation diagram
    (PSD).

    Can you give me a link to some screenshots so I can get on the same
    page? Thanks. Are you almost done with your Fortran port?


    If the users run a dynamic (time sensitive) version of the
    simulation, the user can roll through their displayed results on the
    various sheets of the PSD using their time breaks.

    Cool. Fwiw, check this shit out:

    https://youtu.be/poXeq5V0dso

    A simulation for the field of one of my circle intersection fractals.


    --- 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 Aug 14 20:32:52 2026
    On 8/14/2026 1:49 PM, Johann 'Myrkraverk' Oskarsson wrote:
    [...]

    Deal with it, you fucking cuck!

    Ahhh. Again. I am right.

    --- 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 Aug 14 22:51:02 2026
    On 8/14/2026 9:24 PM, Chris M. Thomasson wrote:
    On 8/14/2026 2:40 PM, Lynn McGuire wrote:
    On 8/14/2026 3:51 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:48 PM, Lynn McGuire wrote:
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where chemicals >>>>>>>> are moving between the four phases of matter that we support: >>>>>>>> vapor, hydrocarbon liquid, aqueous liquid, and solids, based on >>>>>>>> temperature and pressure.˙ The tables are incredibly non-linear. >>>>>>>>
    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do
    some of them look fractal?

    In short, no.˙ We have a diagrammatic user interface that allows our
    users to build a diagram of a chemical process flow diagram such as
    a refinery, a natural gas plan, a pipeline with compressor stations,
    or a chemical plant.
    ˙˙˙ https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of
    that diagram and solves it thermodynamically.˙ If, it can be solved
    as not all chemical processes can be solved due to constraints or
    violation of the laws of thermodynamics.
    Ahhhh! So, you are not making any animations of the processes. Okay.
    But you have the data to do so...

    Fwiw, I bet you already have the data to make one of my 2d examples
    here:

    https://youtu.be/YS-tyDJVy4M

    Actually, I do make an animation of the process simulation diagram (PSD).

    Can you give me a link to some screenshots so I can get on the same
    page? Thanks. Are you almost done with your Fortran port?
    ...

    https://www.winsim.com/screenshots.html

    I am about 1/3rd of the way done with my 800,000 lines of F77 code to
    C++ code. My custom version of F2C is doing about 60 to 70% of the
    work. I am equating the task as equivalent to translating about ten
    long engineering books from German to French. Lots of idioms and basic incompatibilities that have to be ironed out.

    I was shooting for the end of 2026 but that ship has sailed. Maybe
    middle of 2027. Then I have to port to x64 but the port should be easy
    (he says with the ship sitting in ten feet of mud in the harbor).

    Lynn


    --- 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 Aug 14 22:33:01 2026
    On 8/14/2026 8:51 PM, Lynn McGuire wrote:
    On 8/14/2026 9:24 PM, Chris M. Thomasson wrote:
    On 8/14/2026 2:40 PM, Lynn McGuire wrote:
    On 8/14/2026 3:51 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:48 PM, Lynn McGuire wrote:
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where
    chemicals are moving between the four phases of matter that we >>>>>>>>> support: vapor, hydrocarbon liquid, aqueous liquid, and solids, >>>>>>>>> based on temperature and pressure.˙ The tables are incredibly >>>>>>>>> non-linear.

    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do
    some of them look fractal?

    In short, no.˙ We have a diagrammatic user interface that allows
    our users to build a diagram of a chemical process flow diagram
    such as a refinery, a natural gas plan, a pipeline with compressor
    stations, or a chemical plant.
    ˙˙˙ https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of
    that diagram and solves it thermodynamically.˙ If, it can be solved >>>>> as not all chemical processes can be solved due to constraints or
    violation of the laws of thermodynamics.
    Ahhhh! So, you are not making any animations of the processes. Okay.
    But you have the data to do so...

    Fwiw, I bet you already have the data to make one of my 2d examples
    here:

    https://youtu.be/YS-tyDJVy4M

    Actually, I do make an animation of the process simulation diagram
    (PSD).

    Can you give me a link to some screenshots so I can get on the same
    page? Thanks. Are you almost done with your Fortran port?
    ...

    https://www.winsim.com/screenshots.html

    I am about 1/3rd of the way done with my 800,000 lines of F77 code to C+
    + code.˙ My custom version of F2C is doing about 60 to 70% of the work.
    I am equating the task as equivalent to translating about ten long engineering books from German to French.˙ Lots of idioms and basic incompatibilities that have to be ironed out.

    I was shooting for the end of 2026 but that ship has sailed.˙ Maybe
    middle of 2027.˙ Then I have to port to x64 but the port should be easy
    (he says with the ship sitting in ten feet of mud in the harbor).

    Lynn


    Love the flow sheet. Now from there, can you create a vector field?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Ross Finlayson@3:633/10 to All on Sat Aug 15 10:40:50 2026
    On 08/14/2026 08:51 PM, Lynn McGuire wrote:
    On 8/14/2026 9:24 PM, Chris M. Thomasson wrote:
    On 8/14/2026 2:40 PM, Lynn McGuire wrote:
    On 8/14/2026 3:51 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:48 PM, Lynn McGuire wrote:
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where
    chemicals are moving between the four phases of matter that we >>>>>>>>> support: vapor, hydrocarbon liquid, aqueous liquid, and solids, >>>>>>>>> based on temperature and pressure. The tables are incredibly >>>>>>>>> non-linear.

    This is my people and I:
    https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do
    some of them look fractal?

    In short, no. We have a diagrammatic user interface that allows
    our users to build a diagram of a chemical process flow diagram
    such as a refinery, a natural gas plan, a pipeline with compressor
    stations, or a chemical plant.
    https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of
    that diagram and solves it thermodynamically. If, it can be solved
    as not all chemical processes can be solved due to constraints or
    violation of the laws of thermodynamics.
    Ahhhh! So, you are not making any animations of the processes. Okay.
    But you have the data to do so...

    Fwiw, I bet you already have the data to make one of my 2d examples
    here:

    https://youtu.be/YS-tyDJVy4M

    Actually, I do make an animation of the process simulation diagram
    (PSD).

    Can you give me a link to some screenshots so I can get on the same
    page? Thanks. Are you almost done with your Fortran port?
    ...

    https://www.winsim.com/screenshots.html

    I am about 1/3rd of the way done with my 800,000 lines of F77 code to
    C++ code. My custom version of F2C is doing about 60 to 70% of the
    work. I am equating the task as equivalent to translating about ten
    long engineering books from German to French. Lots of idioms and basic incompatibilities that have to be ironed out.

    I was shooting for the end of 2026 but that ship has sailed. Maybe
    middle of 2027. Then I have to port to x64 but the port should be easy
    (he says with the ship sitting in ten feet of mud in the harbor).

    Lynn


    Translating the idioms right makes for "naturals" alignment and storage,
    and so on. Then the numerical methods one imagines are
    involved in solving linearities for invariants and process control,
    then that's involved itself, and the relevance of the compatibility
    of the numerical methods, for their mathematical guarantees, for
    their physical estimates, about how many traincars and truckloads
    of feeder stock under what conditions and augury make diapers or
    galoshes or legos or condoms or pipe or contact lenses or lacquer
    or petrochemicals or drugs or otherwise usually enough more refined
    materials from more raw materials.

    Here it's like "measure-twice cut-once" the old "build a fence
    a mile, could you move it a foot?"

    If the great difference for FORTRAN and C is the account of
    the column-major or row-major and that of arrays and loops,
    then besides a simplest sort of transpose, or organization
    and alignment and storage, then is for the model of computation
    the entry-points and the state & scope, the modules, point being here
    it's perceived as a quite impressive and thoroughgoing sort of
    account of quite very much the value the algorithms and numerical
    methods express as models of control theory.

    The Bessemer furnace, ....

    https://en.wikipedia.org/wiki/Bessemer_process

    Then, there was mentioned "violations of the thermo second law",
    or rather, "accommodations to effects of resonance theory",
    these sorts acconts of "effects", which are basically anything
    outside otherwise the theory, or "exceptions", yes one imagines
    that those make for the accounts of state & scope the quite
    complicated, which for example "exception specification" provides
    in higher-level languages with exception specification as a critical
    component of safety in the modules of software, quite invokes the
    deliberations of "why" instead of merely "because".


    The, "term-rewriting", or a bit more holistically the
    "term-graph-rewriting", is definitely a thing in software since that "generative programming" is a term from the 1960's, and "program
    translation" is is quite usual, then for "models of computation"
    and "modules of computation".


    Long story short such an endeavor is perceived to be a store of
    great _value_, and such porting effort is quite a study of both
    the numerical methods, which as usually approximations need
    their error-bounds modeled, like Runge-Kutta for example after
    Gregory & Coates as Newton's, or about Leontief and so on,
    numerical methods and linear systems and linear solvers,
    then with regards to standard and empirical units, which are
    not necessarily the same and where regimes of effect are
    according to their own units, good luck with that, it sounds
    like something vital to the real-world economy.





    --- 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 Aug 15 11:41:09 2026
    On 8/15/2026 10:40 AM, Ross Finlayson wrote:
    [...]
    Long story short such an endeavor is perceived to be a store of
    great _value_, and such porting effort is quite a study of both
    the numerical methods, which as usually approximations need
    their error-bounds modeled, like Runge-Kutta for example after
    Gregory & Coates as Newton's, or about Leontief and so on,
    numerical methods and linear systems and linear solvers,
    then with regards to standard and empirical units, which are
    not necessarily the same and where regimes of effect are
    according to their own units, good luck with that, it sounds
    like something vital to the real-world economy.

    Long story short... I am not using RK for the intermediate vector field integration points, but its still pretty good. Example:

    https://youtu.be/Doeci7xBYh0



    --- 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 Sun Aug 16 14:58:10 2026
    On 8/14/2026 2:40 PM, Lynn McGuire wrote:
    [...]

    Fwiw, check this out, another one of my field renders:

    https://youtu.be/ygmp_XvdaqQ

    --- 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 Aug 16 22:49:05 2026
    On Fri, 14 Aug 2026 13:54:54 -0500, Lynn McGuire wrote:

    BTW, in Smalltalk you can return any type of object from a method.
    But if the caller got a weird object back, it was a place of
    confusion and often a crash as the expected object type was not the
    actual object type.

    I way prefer strongly typed languages now.

    Smalltalk IS ?strongly typed?. I think you mean ?statically typed?, as
    opposed to ?dynamically typed?.

    So, all objects had to have a common set of methods (read, write,
    print, add, etc) to keep weird crashes from happening. I ended up
    putting all methods at an object and the base object too. Our base
    object had hundreds of methods to handle weird cases.

    Shouldn?t you have cleaned up the code to deal properly with the
    different object types?

    This is why newer dynamic languages, like Python, are introducing type annotations. These are handled by a separate processor (… la ?lint?
    for C code) which tries to flag up inconsistencies between expected
    and actual types, as indicated by a static analysis of the
    annotations. This would let you fix up those inconsistencies even
    before the code gets a chance to run.

    Of course such a scheme is not perfect, and can never be, without
    giving up dynamic typing altogether. And then you?d probably end up
    with Java or something.

    --- 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 Aug 17 06:40:56 2026
    On Thu, 13 Aug 2026 19:07:02 -0500, Lynn McGuire wrote:

    I would rather see a standard user interface toolkit for C++ first.

    With only one exception I?m aware of, there is no standard UI toolkit
    for *any* cross-platform language, for obvious reasons.

    Though interestingly, there has been a proposal knocking around among
    the C++ standardization committee for some years for a standard 2D
    graphics API. Like the one that has been incorporated in JavaScript,
    this one is also based on Cairo <https://www.cairographics.org/>, but
    unlike that, it seems to be even less complete, omitting even text functionality.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Mon Aug 17 21:40:56 2026
    On 17/08/2026 2:40 PM, Lawrence D?Oliveiro wrote:
    On Thu, 13 Aug 2026 19:07:02 -0500, Lynn McGuire wrote:

    I would rather see a standard user interface toolkit for C++ first.

    With only one exception I?m aware of, there is no standard UI toolkit
    for *any* cross-platform language, for obvious reasons.

    What are you talking about? You're running your mouth off again, with-
    out having the faintest clue what you're talking about. There is a
    standard UI toolkit, and it's called IUP, and exists for all major 2D
    graphical operating systems.


    Though interestingly, there has been a proposal knocking around among
    the C++ standardization committee for some years for a standard 2D
    graphics API. Like the one that has been incorporated in JavaScript,
    this one is also based on Cairo <https://www.cairographics.org/>, but
    unlike that, it seems to be even less complete, omitting even text functionality.

    Yes, that's a failure of the C++ committee. They just can't admit to themselves that the very best UI toolkit out there is meant for C pro- grammers.

    Otherwise, they'd have standardized IUP decades ago!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- 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 Mon Aug 17 14:48:31 2026
    On 8/15/2026 12:40 PM, Ross Finlayson wrote:
    On 08/14/2026 08:51 PM, Lynn McGuire wrote:
    On 8/14/2026 9:24 PM, Chris M. Thomasson wrote:
    On 8/14/2026 2:40 PM, Lynn McGuire wrote:
    On 8/14/2026 3:51 PM, Chris M. Thomasson wrote:
    On 8/14/2026 1:48 PM, Lynn McGuire wrote:
    On 8/14/2026 2:08 PM, Chris M. Thomasson wrote:
    On 8/13/2026 10:58 PM, Lynn McGuire wrote:
    On 8/13/2026 8:51 PM, Chris M. Thomasson wrote:
    On 8/13/2026 4:59 PM, Lynn McGuire wrote:
    [...]
    Mine is coming from a chemical process simulator where
    chemicals are moving between the four phases of matter that we >>>>>>>>>> support: vapor, hydrocarbon liquid, aqueous liquid, and solids, >>>>>>>>>> based on temperature and pressure.˙ The tables are incredibly >>>>>>>>>> non-linear.

    This is my people and I:
    ˙˙˙ https://www.winsim.com/

    Notice any fractal growth in there?

    We don't do that.
    Let me clarify... Do you make renders of a simulation? If so, do >>>>>>> some of them look fractal?

    In short, no.˙ We have a diagrammatic user interface that allows
    our users to build a diagram of a chemical process flow diagram
    such as a refinery, a natural gas plan, a pipeline with compressor >>>>>> stations, or a chemical plant.
    ˙˙˙ https://www.winsim.com/screenshots.html

    And we have a calculation engine that takes a textual version of
    that diagram and solves it thermodynamically.˙ If, it can be solved >>>>>> as not all chemical processes can be solved due to constraints or
    violation of the laws of thermodynamics.
    Ahhhh! So, you are not making any animations of the processes. Okay. >>>>> But you have the data to do so...

    Fwiw, I bet you already have the data to make one of my 2d examples
    here:

    https://youtu.be/YS-tyDJVy4M

    Actually, I do make an animation of the process simulation diagram
    (PSD).

    Can you give me a link to some screenshots so I can get on the same
    page? Thanks. Are you almost done with your Fortran port?
    ...

    https://www.winsim.com/screenshots.html

    I am about 1/3rd of the way done with my 800,000 lines of F77 code to
    C++ code.˙ My custom version of F2C is doing about 60 to 70% of the
    work.˙ I am equating the task as equivalent to translating about ten
    long engineering books from German to French.˙ Lots of idioms and basic
    incompatibilities that have to be ironed out.

    I was shooting for the end of 2026 but that ship has sailed.˙ Maybe
    middle of 2027.˙ Then I have to port to x64 but the port should be easy
    (he says with the ship sitting in ten feet of mud in the harbor).

    Lynn


    Translating the idioms right makes for "naturals" alignment and storage,
    and so on. Then the numerical methods one imagines are
    involved in solving linearities for invariants and process control,
    then that's involved itself, and the relevance of the compatibility
    of the numerical methods, for their mathematical guarantees, for
    their physical estimates, about how many traincars and truckloads
    of feeder stock under what conditions and augury make diapers or
    galoshes or legos or condoms or pipe or contact lenses or lacquer
    or petrochemicals or drugs or otherwise usually enough more refined
    materials from more raw materials.

    Here it's like "measure-twice cut-once" the old "build a fence
    a mile, could you move it a foot?"

    If the great difference for FORTRAN and C is the account of
    the column-major or row-major and that of arrays and loops,
    then besides a simplest sort of transpose, or organization
    and alignment and storage, then is for the model of computation
    the entry-points and the state & scope, the modules, point being here
    it's perceived as a quite impressive and thoroughgoing sort of
    account of quite very much the value the algorithms and numerical
    methods express as models of control theory.

    The Bessemer furnace, ....

    https://en.wikipedia.org/wiki/Bessemer_process

    Then, there was mentioned "violations of the thermo second law",
    or rather, "accommodations to effects of resonance theory",
    these sorts acconts of "effects", which are basically anything
    outside otherwise the theory, or "exceptions", yes one imagines
    that those make for the accounts of state & scope the quite
    complicated, which for example "exception specification" provides
    in higher-level languages with exception specification as a critical component of safety in the modules of software, quite invokes the deliberations of "why" instead of merely "because".


    The, "term-rewriting", or a bit more holistically the
    "term-graph-rewriting", is definitely a thing in software since that "generative programming" is a term from the 1960's, and "program
    translation" is is quite usual, then for "models of computation"
    and "modules of computation".


    Long story short such an endeavor is perceived to be a store of
    great _value_, and such porting effort is quite a study of both
    the numerical methods, which as usually approximations need
    their error-bounds modeled, like Runge-Kutta for example after
    Gregory & Coates as Newton's, or about Leontief and so on,
    numerical methods and linear systems and linear solvers,
    then with regards to standard and empirical units, which are
    not necessarily the same and where regimes of effect are
    according to their own units, good luck with that, it sounds
    like something vital to the real-world economy.
    Sorry, I lost you in the first part of your reply. If you are saying
    that it is a tough translation, yes it is. Especially since much of our Fortran was written back in the middle 1960s with Fortran II and Fortran
    IV (66). We did not convert to Fortran 77 until 1995 or so due to the
    2X cost to compile code on the mainframes using the F77 compiler instead
    of the F66 compiler. And the source code is mostly uncommented since we
    paid a penny a line / time period (day ? month ? year?) to store the
    source code on the Univac 1108.

    The worst part of the translation is converting from arrays starting at
    one to arrays starting at zero. My translation tool is converting all
    of the multiple dimensioned arrays to single dimensioned arrays for me
    to get out of the array ordering issues.

    I am equating the translation to converting a dozen highly technical
    books written in German to French.

    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 Mon Aug 17 14:56:59 2026
    On 8/16/2026 5:49 PM, Lawrence D?Oliveiro wrote:
    On Fri, 14 Aug 2026 13:54:54 -0500, Lynn McGuire wrote:

    BTW, in Smalltalk you can return any type of object from a method.
    But if the caller got a weird object back, it was a place of
    confusion and often a crash as the expected object type was not the
    actual object type.

    I way prefer strongly typed languages now.

    Smalltalk IS ?strongly typed?. I think you mean ?statically typed?, as opposed to ?dynamically typed?.
    ...
    Our particular variant of Smalltalk, Whitewater Actor, was not strongly
    typed. You could have a var calling any gibberish that you called a
    method and it was not linked until runtime with the subsequent crash.
    https://en.wikipedia.org/wiki/Actor_(programming_language)

    The only thing that I miss about Smalltalk is the casual heterogeneous collections. Those were immensely useful. I built several classes in
    C++ to model them with a common ancestor class but never got the same
    effect.

    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 Mon Aug 17 15:17:12 2026
    On 8/16/2026 5:49 PM, Lawrence D?Oliveiro wrote:
    On Fri, 14 Aug 2026 13:54:54 -0500, Lynn McGuire wrote:

    BTW, in Smalltalk you can return any type of object from a method.
    But if the caller got a weird object back, it was a place of
    confusion and often a crash as the expected object type was not the
    actual object type.

    I way prefer strongly typed languages now.

    Smalltalk IS ?strongly typed?. I think you mean ?statically typed?, as opposed to ?dynamically typed?.

    So, all objects had to have a common set of methods (read, write,
    print, add, etc) to keep weird crashes from happening. I ended up
    putting all methods at an object and the base object too. Our base
    object had hundreds of methods to handle weird cases.

    Shouldn?t you have cleaned up the code to deal properly with the
    different object types?
    ...

    Yup. My employees and I converted all of the Smalltalk code to C++
    using a Act2Cpp translator that I wrote. Works like a champ and runs
    120X faster. Yes, I timed the old code versus the new code.

    The C++ code was more verbose. 250,000 lines of Smalltalk converted to 450,000 lines of C++. Tough tookie, the speed was everything. And
    Win32 instead of Win16. Some of my customers are using datasets over a gigabyte in size so we are moving to Win64 soon as soon as my employee finishes the Unicode port, the first version of the software ran under
    Windows 2.0.

    Lynn


    --- 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 Aug 17 23:53:19 2026
    On Mon, 17 Aug 2026 14:56:59 -0500, Lynn McGuire wrote:

    On 8/16/2026 5:49 PM, Lawrence D?Oliveiro wrote:

    On Fri, 14 Aug 2026 13:54:54 -0500, Lynn McGuire wrote:

    BTW, in Smalltalk you can return any type of object from a method.
    But if the caller got a weird object back, it was a place of
    confusion and often a crash as the expected object type was not
    the actual object type.

    I way prefer strongly typed languages now.

    Smalltalk IS ?strongly typed?. I think you mean ?statically typed?,
    as opposed to ?dynamically typed?.
    ...
    Our particular variant of Smalltalk, Whitewater Actor, was not
    strongly typed. You could have a var calling any gibberish that you
    called a method and it was not linked until runtime with the
    subsequent crash.
    https://en.wikipedia.org/wiki/Actor_(programming_language)

    Ah, I see. Looks like they were relying on a generic machine-code
    linker to tie things together, instead of having their own
    language-specific linking layer to avoid accidents like this.

    The only thing that I miss about Smalltalk is the casual
    heterogeneous collections. Those were immensely useful. I built
    several classes in C++ to model them with a common ancestor class
    but never got the same effect.

    Is that just a list or table where the entries can have any type?
    That?s a standard thing in any dynamic language, surely.

    --- 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 Mon Aug 17 19:59:50 2026
    On 8/17/2026 6:53 PM, Lawrence D?Oliveiro wrote:
    On Mon, 17 Aug 2026 14:56:59 -0500, Lynn McGuire wrote:

    On 8/16/2026 5:49 PM, Lawrence D?Oliveiro wrote:

    On Fri, 14 Aug 2026 13:54:54 -0500, Lynn McGuire wrote:

    BTW, in Smalltalk you can return any type of object from a method.
    But if the caller got a weird object back, it was a place of
    confusion and often a crash as the expected object type was not
    the actual object type.

    I way prefer strongly typed languages now.

    Smalltalk IS ?strongly typed?. I think you mean ?statically typed?,
    as opposed to ?dynamically typed?.
    ...
    Our particular variant of Smalltalk, Whitewater Actor, was not
    strongly typed. You could have a var calling any gibberish that you
    called a method and it was not linked until runtime with the
    subsequent crash.
    https://en.wikipedia.org/wiki/Actor_(programming_language)

    Ah, I see. Looks like they were relying on a generic machine-code
    linker to tie things together, instead of having their own
    language-specific linking layer to avoid accidents like this.

    The only thing that I miss about Smalltalk is the casual
    heterogeneous collections. Those were immensely useful. I built
    several classes in C++ to model them with a common ancestor class
    but never got the same effect.

    Is that just a list or table where the entries can have any type?
    That?s a standard thing in any dynamic language, surely.

    Yup. Smalltalk had Dictionary, Bag, and Map. All heterogeneous.

    Lynn


    Lynn


    --- 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 Tue Aug 18 02:47:31 2026
    On Mon, 17 Aug 2026 19:59:50 -0500, Lynn McGuire wrote:

    On 8/17/2026 6:53 PM, Lawrence D?Oliveiro wrote:

    On Mon, 17 Aug 2026 14:56:59 -0500, Lynn McGuire wrote:

    The only thing that I miss about Smalltalk is the casual
    heterogeneous collections. Those were immensely useful. I built
    several classes in C++ to model them with a common ancestor class
    but never got the same effect.

    Is that just a list or table where the entries can have any type?
    That?s a standard thing in any dynamic language, surely.

    Yup. Smalltalk had Dictionary, Bag, and Map. All heterogeneous.

    Python has actual expressions you can use to build those in the
    language itself. E.g. from <https://gitlab.com/ldo/dbussy>:

    standard_interfaces = \
    {
    DBUS.INTERFACE_PEER :
    # note implementation of this is hard-coded inside libdbus
    Introspection.Interface
    (
    name = DBUS.INTERFACE_PEER,
    methods =
    [
    Introspection.Interface.Method(name = "Ping"),
    Introspection.Interface.Method
    (
    name = "GetMachineId",
    args =
    [
    Introspection.Interface.Method.Arg
    (
    name = "machine_uuid",
    type = BasicType(TYPE.STRING),
    direction = Introspection.DIRECTION.OUT,
    ),
    ]
    ),
    ],
    ),
    DBUS.INTERFACE_LOCAL :
    # note implementation of this is hard-coded inside, and specific to, libdbus
    Introspection.Interface
    (
    name = DBUS.INTERFACE_LOCAL,
    signals =
    [
    Introspection.Interface.Signal(name = "Disconnected"),
    # auto-generated by libdbus with path = DBUS.PATH_LOCAL
    # when connection is closed; cannot be explicitly sent by
    # clients. Documented here:
    # <https://lists.freedesktop.org/archives/dbus/2018-October/017587.html>
    ],
    ),
    ...
    }

    --- 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 Tue Aug 18 00:42:58 2026
    On 8/11/2026 3:01 AM, Lynn McGuire wrote:
    Why is there not a ipow version of pow?

    ipow would return an int instead of a double.˙ Or a long long int.

    Thanks,
    Lynn

    Here is my code to date (longint is long long int):

    // ipow.cpp

    // calculate an longint power of a longint number

    // INPUT:
    // base - longint value of number
    // exp - longint
    // OUTPUT:
    // longint value of base to the exp power

    // REVISIONS:
    // ==========
    // 08/11/26 Lynn McGuire created using
    // https://stackoverflow.com/questions/101439/the-most-efficient-way-to-implement-an-integer-based-power-function-powint-int

    #include "dii.h"

    longint ipow (longint base, longint exp)
    {
    longint result = 1;
    std::string str;

    if (exp == 0 || base == 0) {
    return result;
    }

    if (exp < 0) {
    scrwri ("");
    str = "ERROR: exp is negative, " + asString (exp) + " (ipow)";
    scrwri (str);
    scrwri ("");
    quit ();
    return 0;
    }

    for (;;)
    {
    if (exp & 1)
    result *= base;
    exp >>= 1;
    if (!exp)
    break;
    base *= base;
    }

    return result;
    } /* ipow */

    Thanks,
    Lynn


    --- 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 Tue Aug 18 09:34:32 2026
    Am 18.08.2026 um 07:42 schrieb Lynn McGuire:

    longint ipow (longint base, longint exp)
    {
    ˙˙˙˙longint result = 1;
    ˙˙˙˙std::string str;

    ˙˙˙˙if (exp == 0 || base == 0) {
    ˙˙˙˙˙˙˙ return result;
    ˙˙˙˙}

    ˙˙˙˙if (exp < 0) {
    ˙˙˙˙˙˙˙ scrwri ("");
    ˙˙˙˙˙˙˙ str = "ERROR: exp is negative, " + asString (exp) + " (ipow)";
    ˙˙˙˙˙˙˙ scrwri (str);
    ˙˙˙˙˙˙˙ scrwri ("");
    ˙˙˙˙˙˙˙ quit ();
    ˙˙˙˙˙˙˙ return 0;
    ˙˙˙˙}

    If x is negative and base is zero you get an infinite result. If base
    is +/-1 you get a result of +/-1, depending on if the exponent is odd
    or not. If abs( base ) is > 1 you get zero.


    ˙˙˙˙for (;;)
    ˙˙˙˙{
    ˙˙˙˙˙˙˙ if (exp & 1)
    ˙˙˙˙˙˙˙˙˙˙˙ result *= base;
    ˙˙˙˙˙˙˙ exp >>= 1;
    ˙˙˙˙˙˙˙ if (!exp)
    ˙˙˙˙˙˙˙˙˙˙˙ break;
    ˙˙˙˙˙˙˙ base *= base;
    ˙˙˙˙}

    You've to check exp at the begining. And it's better to have an
    overflow detection. But this is possible only with unsigned values
    since the compiler can assume that signeds don't overflow.

    ˙˙˙˙return result;
    }˙ /* ipow */


    --- 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 Tue Aug 18 11:32:22 2026
    On 18/08/2026 07:42, Lynn McGuire wrote:
    On 8/11/2026 3:01 AM, Lynn McGuire wrote:
    Why is there not a ipow version of pow?

    ipow would return an int instead of a double.˙ Or a long long int.

    Thanks,
    Lynn

    Here is my code to date (longint is long long int):

    //˙ ipow.cpp

    //˙ calculate an longint power of a longint number

    //˙ INPUT:
    //˙˙˙˙ base - longint value of number
    //˙˙˙˙ exp - longint
    //˙ OUTPUT:
    //˙˙˙˙ longint value of base to the exp power

    // REVISIONS:
    // ==========
    //˙ 08/11/26˙ Lynn McGuire˙ created using
    // https://stackoverflow.com/questions/101439/the-most-efficient-way-to- implement-an-integer-based-power-function-powint-int

    #include "dii.h"

    longint ipow (longint base, longint exp)
    {
    ˙˙˙˙longint result = 1;
    ˙˙˙˙std::string str;

    ˙˙˙˙if (exp == 0 || base == 0) {
    ˙˙˙˙˙˙˙ return result;
    ˙˙˙˙}

    ˙˙˙˙if (exp < 0) {
    ˙˙˙˙˙˙˙ scrwri ("");
    ˙˙˙˙˙˙˙ str = "ERROR: exp is negative, " + asString (exp) + " (ipow)";
    ˙˙˙˙˙˙˙ scrwri (str);
    ˙˙˙˙˙˙˙ scrwri ("");
    ˙˙˙˙˙˙˙ quit ();
    ˙˙˙˙˙˙˙ return 0;
    ˙˙˙˙}

    ˙˙˙˙for (;;)
    ˙˙˙˙{
    ˙˙˙˙˙˙˙ if (exp & 1)
    ˙˙˙˙˙˙˙˙˙˙˙ result *= base;
    ˙˙˙˙˙˙˙ exp >>= 1;
    ˙˙˙˙˙˙˙ if (!exp)
    ˙˙˙˙˙˙˙˙˙˙˙ break;
    ˙˙˙˙˙˙˙ base *= base;
    ˙˙˙˙}

    ˙˙˙˙return result;
    }˙ /* ipow */


    It seems odd to have a run-time check for the very unlikely case of a
    negative exponent, and no run-time check for overflow.

    You should also drop the C90 "declare all variables at the top of the function" style. It's a bad idea in C, and a terrible idea in C++. You
    don't want to be unnecessarily creating a std::string object and running
    its constructor and destructor in a function that should be fast.
    Instead, put the declaration where it is needed :

    const std::string str = "ERROR ..."

    I don't know if you are using exceptions in your code base, but if you
    are, they would be a better choice here. Then your function could be
    made "constexpr" as well as being more efficient in the normal case.


    --- 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 Aug 21 17:22:30 2026
    On 8/18/2026 4:32 AM, David Brown wrote:
    ...
    You should also drop the C90 "declare all variables at the top of the function" style.˙ It's a bad idea in C, and a terrible idea in C++.˙ You don't want to be unnecessarily creating a std::string object and running
    its constructor and destructor in a function that should be fast.
    Instead, put the declaration where it is needed :

    ˙˙˙˙const std::string str = "ERROR ..."

    Real programmers can write Fortran code in any language.

    Lynn




    --- 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 Sat Aug 22 12:30:42 2026
    On 22/08/2026 00:22, Lynn McGuire wrote:
    On 8/18/2026 4:32 AM, David Brown wrote:
    ...
    You should also drop the C90 "declare all variables at the top of the
    function" style.˙ It's a bad idea in C, and a terrible idea in C++.
    You don't want to be unnecessarily creating a std::string object and
    running its constructor and destructor in a function that should be
    fast. Instead, put the declaration where it is needed :

    ˙˙˙˙˙const std::string str = "ERROR ..."

    Real programmers can write Fortran code in any language.


    That may be true - but the real question is, should they?


    --- 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 Mon Aug 24 19:09:00 2026
    On 8/22/2026 5:30 AM, David Brown wrote:
    On 22/08/2026 00:22, Lynn McGuire wrote:
    On 8/18/2026 4:32 AM, David Brown wrote:
    ...
    You should also drop the C90 "declare all variables at the top of the
    function" style.˙ It's a bad idea in C, and a terrible idea in C++.
    You don't want to be unnecessarily creating a std::string object and
    running its constructor and destructor in a function that should be
    fast. Instead, put the declaration where it is needed :

    ˙˙˙˙˙const std::string str = "ERROR ..."

    Real programmers can write Fortran code in any language.


    That may be true - but the real question is, should they?

    Sure.

    Lynn


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Rosario19@3:633/10 to All on Sat Aug 29 17:22:31 2026
    On Tue, 11 Aug 2026 16:56:04 +0200, Bonita Montero wrote:

    This is the integer pow() code so far I wrote in C++:

    template<typename Int>
    constexpr optional<Int> ipow( Int b, Int e )
    {
    constexpr bool Sgn = is_signed_v<Int>;
    using uint = make_unsigned_t<Int>;
    if( !b )
    return !e;
    uint ub, ue;
    if constexpr( Sgn )
    if( e >= 0 )
    {
    ub = abs( b );
    ue = abs( e );
    }
    else
    return abs( b ) == 1;
    else
    ub = b, ue = e;
    uint result = 1, msk = 1, sq = ub;
    while( ue )
    {
    if( (ue & msk) )
    {
    uint next = result * sq;
    if( next / sq != result )
    return nullopt;
    result = next;
    ue &= ~msk;
    }
    msk <<= 1;
    if( sq * sq / sq != sq )
    return nullopt;
    sq *= sq;
    }
    if constexpr( Sgn )
    if( bool neg = b < 0; neg && (e & 1) )
    if( result <= (uint)numeric_limits<Int>::min() )
    result = -(Int)result;
    else
    return nullopt;
    return result;

    }

    I didn't test all corner cases, but for values which don't overflow the
    code should be corrent. The crucial case about the performance here is
    that I need a division to check for overflows; in these cases you get
    a nullopt. With fp-values you get inf and that's less expensive.

    float can not handle numbers ipow or ltor or powermod can...
    example ipow(123456,123456) with the right trunched result...


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Sat Aug 29 15:43:36 2026
    On Sat, 29 Aug 2026 17:22:31 +0200
    Rosario19 <Ros@invalid.invalid> gabbled:
    On Tue, 11 Aug 2026 16:56:04 +0200, Bonita Montero wrote:

    This is the integer pow() code so far I wrote in C++:

    template<typename Int>
    constexpr optional<Int> ipow( Int b, Int e )
    {
    constexpr bool Sgn = is_signed_v<Int>;
    using uint = make_unsigned_t<Int>;
    if( !b )
    return !e;
    uint ub, ue;
    if constexpr( Sgn )
    if( e >= 0 )
    {
    ub = abs( b );
    ue = abs( e );
    }
    else
    return abs( b ) == 1;
    else
    ub = b, ue = e;
    uint result = 1, msk = 1, sq = ub;
    while( ue )
    {
    if( (ue & msk) )
    {
    uint next = result * sq;
    if( next / sq != result )
    return nullopt;
    result = next;
    ue &= ~msk;
    }
    msk <<= 1;
    if( sq * sq / sq != sq )
    return nullopt;
    sq *= sq;
    }
    if constexpr( Sgn )
    if( bool neg = b < 0; neg && (e & 1) )
    if( result <= (uint)numeric_limits<Int>::min() )
    result = -(Int)result;
    else
    return nullopt;
    return result;

    }

    I didn't test all corner cases, but for values which don't overflow the >>code should be corrent. The crucial case about the performance here is
    that I need a division to check for overflows; in these cases you get
    a nullopt. With fp-values you get inf and that's less expensive.

    float can not handle numbers ipow or ltor or powermod can...
    example ipow(123456,123456) with the right trunched result...

    Also maths functions should never return an optional. They should return the numeric result or NaN.


    --- 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 Sun Aug 30 05:33:31 2026
    Am 29.08.2026 um 17:43 schrieb boltar@caprica.universe:

    Also maths functions should never return an optional. They should return the numeric result or NaN.
    There are no NaNs with integrals, so an optional is o.k..


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Sun Aug 30 13:02:01 2026
    On Sun, 30 Aug 2026 05:33:31 +0200
    Bonita Montero <Bonita.Montero@gmail.com> gabbled:
    Am 29.08.2026 um 17:43 schrieb boltar@caprica.universe:

    Also maths functions should never return an optional. They should return the >> numeric result or NaN.
    There are no NaNs with integrals, so an optional is o.k..

    Wtf are you talking about, its raising an integer to a power, integrals don't come into it.


    --- 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 Sun Aug 30 19:53:53 2026
    Am 30.08.2026 um 15:02 schrieb boltar@caprica.universe:

    Wtf are you talking about, its raising an integer to a power, integrals don't come into it.
    An integer pow can easily be out of bounds, that's while I'm
    using an optional to signal that. In my latest version I even
    use a std::expected to signal an overflow and an infinte result.
    That's proper coding.


    --- 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 Aug 31 10:04:06 2026
    On 30/08/2026 15:02, boltar@caprica.universe wrote:
    On Sun, 30 Aug 2026 05:33:31 +0200
    Bonita Montero <Bonita.Montero@gmail.com> gabbled:
    Am 29.08.2026 um 17:43 schrieb boltar@caprica.universe:

    Also maths functions should never return an optional. They should
    return the
    numeric result or NaN.
    There are no NaNs with integrals, so an optional is o.k..

    Wtf are you talking about, its raising an integer to a power, integrals don't
    come into it.


    I assume Bonita was using "integral" as an adjective - an alternative to "integer types" - rather than the term from calculus.

    The discussion was about a function that raises an integer to an
    integer, returning an integer - with various possible choices of the
    concrete integer types to use. Integer types in C and C++ do not have
    NaNs or other error value indicators. So this kind of function cannot
    use such returns to indicate errors.

    Alternatives include :

    1. Let overflow be UB, and don't care what you return on overflow.

    2. Pick a specific integer value to return if there is an overflow.

    3. Call an error-handling function of some sort.

    4. Throw an exception (C++ only, obviously).

    5. Use a side-channel indication, like errno.

    6. Augment the return to include an indication of error or the validity
    of the result. For C++, std::optional<> and std::expected<> are both
    solid choices there.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From bart@3:633/10 to All on Mon Aug 31 14:18:58 2026
    On 31/08/2026 09:04, David Brown wrote:
    On 30/08/2026 15:02, boltar@caprica.universe wrote:
    On Sun, 30 Aug 2026 05:33:31 +0200
    Bonita Montero <Bonita.Montero@gmail.com> gabbled:
    Am 29.08.2026 um 17:43 schrieb boltar@caprica.universe:

    Also maths functions should never return an optional. They should
    return the
    numeric result or NaN.
    There are no NaNs with integrals, so an optional is o.k..

    Wtf are you talking about, its raising an integer to a power,
    integrals don't
    come into it.


    I assume Bonita was using "integral" as an adjective - an alternative to "integer types" - rather than the term from calculus.

    The discussion was about a function that raises an integer to an
    integer, returning an integer - with various possible choices of the concrete integer types to use.˙ Integer types in C and C++ do not have
    NaNs or other error value indicators.˙ So this kind of function cannot
    use such returns to indicate errors.

    Alternatives include :

    1. Let overflow be UB, and don't care what you return on overflow.

    Yes, I don't see the need for:

    if (ipow(a, 2) + ipow(b, 2) == ipow(c, 2))

    to behave any differently from:

    if (a*a + b*b == c*c)

    2. Pick a specific integer value to return if there is an overflow.

    3. Call an error-handling function of some sort.

    4. Throw an exception (C++ only, obviously).

    5. Use a side-channel indication, like errno.

    6. Augment the return to include an indication of error or the validity
    of the result.˙ For C++, std::optional<> and std::expected<> are both
    solid choices there.

    How would this even work for an example that looks like the above?

    With NaNs, I believe a NaN result early in a expression will propagate
    through to the result, so can be tested for once, or can itself propagate.

    'ipow' would be used where it is more convenient or appropriate than the alternative, or where the exponent is a variable, or where it imparts
    useful extra information.

    (Obviously, in my example, ipow needs more typing and is less convenient.)




    --- 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 Aug 31 14:48:17 2026
    David Brown <david.brown@hesbynett.no> writes:
    On 30/08/2026 15:02, boltar@caprica.universe wrote:

    The discussion was about a function that raises an integer to an
    integer, returning an integer - with various possible choices of the >concrete integer types to use. Integer types in C and C++ do not have
    NaNs or other error value indicators. So this kind of function cannot
    use such returns to indicate errors.

    Alternatives include :


    4. Throw an exception (C++ only, obviously).

    cf. longjmp.

    --- 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 Aug 31 17:25:49 2026
    On 31/08/2026 15:18, bart wrote:
    On 31/08/2026 09:04, David Brown wrote:
    On 30/08/2026 15:02, boltar@caprica.universe wrote:
    On Sun, 30 Aug 2026 05:33:31 +0200
    Bonita Montero <Bonita.Montero@gmail.com> gabbled:
    Am 29.08.2026 um 17:43 schrieb boltar@caprica.universe:

    Also maths functions should never return an optional. They should
    return the
    numeric result or NaN.
    There are no NaNs with integrals, so an optional is o.k..

    Wtf are you talking about, its raising an integer to a power,
    integrals don't
    come into it.


    I assume Bonita was using "integral" as an adjective - an alternative
    to "integer types" - rather than the term from calculus.

    The discussion was about a function that raises an integer to an
    integer, returning an integer - with various possible choices of the
    concrete integer types to use.˙ Integer types in C and C++ do not have
    NaNs or other error value indicators.˙ So this kind of function cannot
    use such returns to indicate errors.

    Alternatives include :

    1. Let overflow be UB, and don't care what you return on overflow.

    Yes, I don't see the need for:

    ˙˙ if (ipow(a, 2) + ipow(b, 2) == ipow(c, 2))

    to behave any differently from:

    ˙˙ if (a*a + b*b == c*c)

    Agreed.


    2. Pick a specific integer value to return if there is an overflow.

    3. Call an error-handling function of some sort.

    4. Throw an exception (C++ only, obviously).

    5. Use a side-channel indication, like errno.

    6. Augment the return to include an indication of error or the
    validity of the result.˙ For C++, std::optional<> and std::expected<>
    are both solid choices there.

    How would this even work for an example that looks like the above?

    A C++ std::optional<int> is approximately like a struct with an int, and
    a bool to indicate validity, along with some convenient operations and conversions.


    With NaNs, I believe a NaN result early in a expression will propagate through to the result, so can be tested for once, or can itself propagate.


    With std::optional<int>, you would still need to do some testing of the results to see if you had a successful "int" or not. But the result
    type carries this information along with non-overflow result, and is relatively neat to test.

    It is possible in C++ to do better. Perhaps a good choice would be a
    template "checked<>" so that a "checked<int>" carries a bool "NaN" flag
    along with a non-NaN value. Then common integer operations could be overloaded to support this in a similar manner to a non-signalling NaN
    in floating point. (It would also be possible to use INT_MAX to
    indicate NaN, keeping the type more compact.)

    'ipow' would be used where it is more convenient or appropriate than the alternative, or where the exponent is a variable, or where it imparts
    useful extra information.

    (Obviously, in my example, ipow needs more typing and is less convenient.)



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