Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: [OT: JavaScript] JS remainder operation ('%')

by syphilis (Archbishop)
on Jan 17, 2024 at 14:15 UTC ( [id://11157046]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^3: [OT: JavaScript] JS remainder operation ('%')
by choroba (Cardinal) on Jan 17, 2024 at 14:20 UTC
    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]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11157046]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-05-21 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found