It instantiates a Single type based on the return value from the
CSng Function.
The CSng function converts an expression to type Single.
The value that it is converting is the result of:
- -((num2 = Single.MinValue) > False)
If you break it down:
You are checking to see if the
num2
value is equal to the
Single.MinValue (-3.402823e38)
This will return a boolean type (true or false)
For some reason you are checking to see if this returned value is greater than false. Since true/false is just a yes/no, or 1/0 this is strange and could possibly throw errors.
I'm going to assume that when you use the [icode]>[icode] operator on a boolean, that it casts it into a number in order to do the comparison.
So, assuming that
true=1
and
false=0
, you are checking to see if the result returns true since
true>false
.
This is not needed and is quite confusing.
Anyways, the code determines if
num2
is equal to
-3.402823e38
...it then checks to see if the result is greater than false (in other words it checks to see if it is true).
Then the you are setting the true or false value to it's negative (flipping it). Assuming you aren't given any errors when you set a boolean to it's negative value.
The CSng function then converts the resulting (flipped) true or false into a Single.
I have no idea what you are trying to accomplish.
This code really is nonsensical.
In the end, assuming you don't have any errors thrown when you treat booleans as numbers,
num
will be instantiated as a -1 or 0 depending on the result of checking
num2
.
My advise to you: Treat booleans as booleans and treat numbers as numbers. Don't cast between them unless you know what you are doing and have a very specific reason for doing so.