Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Modulo of fraction?

by TedPride (Priest)
on Jun 27, 2005 at 18:28 UTC ( [id://470345]=note: print w/replies, xml ) Need Help??


in reply to Modulo of fraction?

If it doesn't work, make yourself a sub to solve the problem instead of worrying about the why :)
use strict; use warnings; print myrem(4, 2.5); sub myrem { return $_[0] - int ($_[0] / $_[1]) * $_[1]; };
You might also want to look at the overload / override modules on CPAN.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found