Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #121754

Re: There is no "correct" result for std::fmod across all IEEE 754

From Michael S <already5chosen@yahoo.com>
Newsgroups comp.lang.c++
Subject Re: There is no "correct" result for std::fmod across all IEEE 754
Date 2025-03-02 16:03 +0200
Organization A noiseless patient Spider
Message-ID <20250302160330.00006845@yahoo.com> (permalink)
References <6in6sjtgdf82rmi09a5q21l7lp19vagb4m@4ax.com> <20250301230320.000074a4@yahoo.com> <tcv6sj1c4j6643nfcfk7jp937dspbksrdf@4ax.com> <20250302110710.00003fa2@yahoo.com> <vq17o2$ncg0$1@dont-email.me>

Show all headers | View raw


On Sun, 2 Mar 2025 09:17:54 -0000 (UTC)
Muttley@DastardlyHQ.org wrote:

> On Sun, 2 Mar 2025 11:07:10 +0200
> Michael S <already5chosen@yahoo.com> wibbled:
> >On Sat, 01 Mar 2025 21:57:13 +0000
> >Mr Flibble <leigh@i42.co.uk> wrote:  
> >> My point is std::fmod is almost useless
> >> MATHEMATICALLY unless the arguments don't involve approximation,
> >> but with IEEE 754 floating point you get what you pay for.
> >> 
> >> /Flibble  
> >
> >If you were saying that fmod(x/y) for big values of x/y is almost
> >useless physically / engineerially then I'd tend to agree.
> >When physicist or engineer says 'double x= bar;' where bar is a
> >number that can be represented exactly in binary64 then what he
> >means (if he cared at all to think about what he means, which is
> >rare) is that he believes that x is in range (bar-ULP:bar+ULP] and
> >he hopes that probability of x being within range
> >[bar-ULP/2:bar+ULP/2] is much higher that 0.5. So, obviously, as
> >long as y is abs(y)<ULP(x) for physicist fmod(x/y) is meaningless.  
> 
> The whole argument is somewhat moot anyway - for serious physics or
> engineering calculations you simply don't use IEE754. These sort of
> applications either require everything to be done in integer (see
> also Fintec) or to use a number library such as GMP where the
> precision is only limited by memory and the speed you require.
> 

That's wrong.
Overwhelming majority of worlds scientific and engineering calculations
is performed with IEEE-754 binary64.
You can call all this people non-serious.
Me, personally, I don't think that Fintech people are not serious, but
at the same time I think that most of them are crooks.

In other field, like signal processing and graphics, the default is
IEEE-754 binary32.
In the modern turn of AI they use even lower precision, like IEEE-754
binary16 and so-called bfloat. And the trend (DeepSeek) is further down
in precision.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-01 19:27 +0000
  Re: There is no "correct" result for std::fmod across all IEEE 754 representations Michael S <already5chosen@yahoo.com> - 2025-03-01 23:03 +0200
    Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-01 21:57 +0000
      Re: There is no "correct" result for std::fmod across all IEEE 754 representations Michael S <already5chosen@yahoo.com> - 2025-03-02 11:07 +0200
        Re: There is no "correct" result for std::fmod across all IEEE 754 Muttley@DastardlyHQ.org - 2025-03-02 09:17 +0000
          Re: There is no "correct" result for std::fmod across all IEEE 754 Michael S <already5chosen@yahoo.com> - 2025-03-02 16:03 +0200
            Re: There is no "correct" result for std::fmod across all IEEE 754 Muttley@dastardlyhq.com - 2025-03-02 16:56 +0000
        Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-02 15:24 +0000
        Re: There is no "correct" result for std::fmod across all IEEE 754 representations James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-02 17:37 -0500
          Re: There is no "correct" result for std::fmod across all IEEE 754 representations Michael S <already5chosen@yahoo.com> - 2025-03-03 13:20 +0200
  Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 16:25 +0100
    Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 16:30 +0100
      Re: There is no "correct" result for std::fmod across all IEEE 754 representations Michael S <already5chosen@yahoo.com> - 2025-03-03 18:54 +0200
    Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 17:11 +0000
      Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 18:26 +0100
        Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 18:20 +0000
          Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 19:26 +0100
            Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 18:33 +0000
              Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 19:37 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 18:46 +0000
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 19:48 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 18:50 +0000
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 19:53 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 18:58 +0000
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 20:05 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 19:09 +0000
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 20:14 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 20:27 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 19:33 +0000
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-03 20:36 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-03 19:37 +0000
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-04 10:42 +0100
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations Mr Flibble <leigh@i42.co.uk> - 2025-03-04 18:24 +0000
                Re: There is no "correct" result for std::fmod across all IEEE 754 representations "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-03 12:25 -0800

csiph-web