Sign in to follow this  
Followers 0
seandisanti

Possible bug using mathematical expressions for boolean checks

2 posts in this topic

it doesn't seem like this should display 2 message boxes, but it does... I couldn't remember if negatives evaluated as true or false, but rather than check the helpfile, i opened up scite and just wrote a check... then because i had nothing better to do, i threw in a 'Not' to see if the condition evaluated to false, but it didn't...

$a = 2
$b = 3
if $a - $b Then MsgBox(0,"yep","negatives evaluate to true")
if Not $a - $b Then MsgBox(0,"yep","negatives evaluate to true")

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites



this

if Not $a - $b Then MsgBox(0,"yep","negatives evaluate to true")

evaluates to ...

(Not $a) - $b

0 -3

try...

if Not ($a - $:P Then MsgBox(0,"yep","negatives evaluate to true")

thanks, didn't even think to check precedence...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0