mIRC Home    About    Download    Register    News    Help

Print Thread
#47849 07/09/03 04:14 PM
Joined: Dec 2002
Posts: 12
G
Gojito Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
My mIRC version: 6.03

//echo -a $calc(0/0)
* /echo: insufficient parameters

//echo -a $calc(1/0)
* /echo: insufficient parameters

I know mIRC isn't a math software.
:tongue:

#47850 07/09/03 04:27 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Division by 0 is undefined resulting in mIRC returning $null. That is 100% mathematically valid, so I'm not sure what you are talking about.

#47851 07/09/03 04:46 PM
Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
$me thinks everything is OK


Go ahead, jump. 100,000 lemmings can't be wrong.
#47852 07/09/03 11:08 PM
Joined: Dec 2002
Posts: 12
G
Gojito Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
//echo -a 1 $+ $calc($calc(0/0)/1) $+ 1
101

//echo -a 1 $+ $calc($null/1) $+ 1
11

If $calc(0/0) is equal to $null then why it happens?

#47853 07/09/03 11:11 PM
Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
0 = "0"
&
$null = ""

that's the way it works


Go ahead, jump. 100,000 lemmings can't be wrong.
#47854 08/09/03 12:20 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I get '101' for both of those.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#47855 08/09/03 09:49 AM
Joined: Dec 2002
Posts: 12
G
Gojito Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
In mIRC 6.1:
//echo -a $calc($null/1) returns "0"
//echo -a $calc($calc(0/0)/1) returns "0"

In mIRC 6.03:
//echo -a $calc($null/1) returns "* /echo: insufficient parameters"
//echo -a $calc($calc(0/0)/1) returns "0"

That's what I'm talking about.
Sorry for post things about an old mIRC version.

#47856 08/09/03 12:18 PM
Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
In mIRC v6.1, $calc() will return zero if you specify non-numeric parameters.

Last edited by Khaled; 08/09/03 01:17 PM.
#47857 08/09/03 12:29 PM
Joined: Dec 2002
Posts: 39
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 39
not that true, in my mIRC v6.1, //echo -a $calc(1/0) results in: * /echo: insufficient parameters

#47858 08/09/03 04:08 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Try reading, if you specify non-numeric parameters. 1 and 0 are both numeric characters.

#47859 08/09/03 04:23 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
he edited it.


new username: tidy_trax
#47860 09/09/03 01:12 AM
Joined: Dec 2002
Posts: 39
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 39
khaled edited his post, but I am almost sure he said it returns 0 for divisions by 0 AND not numeric parameters before :P

#47861 10/09/03 01:25 PM
Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
Larra: yes it did, sorry about that!


Link Copied to Clipboard