mIRC Home    About    Download    Register    News    Help

Print Thread
#132712 13/10/05 07:35 PM
Joined: Oct 2005
Posts: 5
I
iowa666 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Oct 2005
Posts: 5
what is the command for remainder in calc?
for example, lets say i need the remainder from %var divided by 5, how do i get it from $calc ?

#132713 13/10/05 07:43 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
//echo -a $calc(13 % 5)


Gone.
#132714 13/10/05 08:54 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Works even with /var:

//var %a = 10 % 6 | echo -s %a

Only one calculation with /var ofcourse, and put spaces around the % sign smile

#132715 13/10/05 09:20 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Code:
//var %number = $int($calc(10 / 6)) | var %a = $calc(10 % 6) | echo -a  $+(%number,-,%a,$chr(47),6)

k, so how to express the fraction correctly?

#132716 13/10/05 09:28 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I know but he didn't ask it with var, he asked it with $calc :tongue:

Indeed, /var allows for simple math expressions, I use it often, quite handy feature.


Gone.

Link Copied to Clipboard