[J3] Why is += missing?

Steven G. Kargl kargl at uw.edu
Wed Aug 25 15:23:46 UTC 2021


On Wed, Aug 25, 2021 at 08:15:04AM -0600, Ondřej Čertík via J3 wrote:
> 
> I don't think we even need "-=", but we can add it too.
> "*=" is very rarely used in my experience. So is "/=".
>

If J3 is considering the inclusion of these operators from C,
then it may be prudent to take a survey of numerical C codes to
determine the frequency of use before declaring one operator
is more useful than others.  I have (a short?) C code for
computing the KZK equation from nonlinear acoustics:

% wc -l *.c | grep total
    3953 total
% grep "+=" *.c | wc -l
      36
% grep "\-=" *.c | wc -l
      20
% grep "*=" *.c | wc -l
      31
% grep "/=" *.c | wc -l
      16

The total lines of code includes the comments, so the
likely use of these operators is on the order of 4 to
5% LOC.

-- 
Steve


More information about the J3 mailing list