in reply to [OT: JavaScript] JS remainder operation ('%')

Also: The spec, Java at TIO

https://t.ly/EHF3Z
https://t.ly/m7AYI
  • Comment on Re: [OT: JavaScript] JS remainder operation ('%')

Replies are listed 'Best First'.
Re^2: [OT: JavaScript] JS remainder operation ('%')
by syphilis (Archbishop) on Jan 17, 2024 at 14:15 UTC
    https://t.ly/EHF3Z

    Thank You !!!
    From that link: this may be compared with the C library function fmod.
    They're just using the fmod() function from the standard C math.h:
    ## try.pl ## use strict; use warnings; use Inline C => <<'EOC'; double foo(double x, double y) { return fmod(x, y); } EOC print foo(900719925474099.7, 2147483647.83); __END__ Outputs: 859064762.882
    How is it possible that the XP of Anonymous Monk is less than that of Vroom ???
    (Defies all logic ;-)

    Cheers,
    Rob
      Alternatively
      #! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use POSIX qw{ fmod }; say fmod(900719925474099.7, 2147483647.83);

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]