mIRC Home    About    Download    Register    News    Help

Print Thread
#31496 22/06/03 04:15 PM
Joined: Jan 2003
Posts: 24
C
Codeq Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jan 2003
Posts: 24
Hi
its nothin big but a bit confusing..

alias test { if (0.1 == $calc(1/10)) { echo -a SUPER } }

why cant mirc calculate this correctly? btw.. //echo -a $calc(1/10) is exactly 0.1 ... even mirc says so, but not within an expression ...

grz Codeq


--
Codeq (J. Diel)
euIRCnet LocOp (irc.hes.de.euirc.net)
http://coding-board.de | www.euirc.net
#31497 22/06/03 04:34 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
That works perfectly. It prints "SUPER"

#31498 22/06/03 04:44 PM
Joined: Jan 2003
Posts: 24
C
Codeq Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jan 2003
Posts: 24
ok.. thats funny..
if i use it as an alias
"test { if (0.1 == $calc(1/10)) { echo -a SUPER } }"
than it works

but if i place that source into an remote script
"alias test { if (0.1 == $calc(1/10)) { echo -a SUPER } }"
it dosnt




--
Codeq (J. Diel)
euIRCnet LocOp (irc.hes.de.euirc.net)
http://coding-board.de | www.euirc.net
#31499 22/06/03 04:44 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
if it doesnt work well for you try it the other way around,
alias test {
if ($calc(1/10) == 0.1) { //echo -a SUPER! }
}


new username: tidy_trax
#31500 22/06/03 04:52 PM
Joined: Jan 2003
Posts: 24
C
Codeq Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jan 2003
Posts: 24
รครครครค.... sorry but this is a bugreport.. maybe im wrong but i dont need any suggestion how to compare 2 floatings ...
0.1 and 1/10 must be the same and at this case they arent .. so why is that? not how to fix or pass it anyway...

wink


--
Codeq (J. Diel)
euIRCnet LocOp (irc.hes.de.euirc.net)
http://coding-board.de | www.euirc.net
#31501 22/06/03 04:54 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
copy and paste this into status window , it should return yes

//echo -a $iif($calc(1/10) == 0.1,yes,no)


new username: tidy_trax
#31502 22/06/03 04:59 PM
Joined: Jan 2003
Posts: 24
C
Codeq Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jan 2003
Posts: 24
[censored] it... crazy

i had a script loaded where someone used an global alias .. so $calc(1/10) works correct...

sorry to bother..

blush blush


--
Codeq (J. Diel)
euIRCnet LocOp (irc.hes.de.euirc.net)
http://coding-board.de | www.euirc.net

Link Copied to Clipboard