Yes. Thanks @EssGeEich!! I added "negating" feature. The
'!' sign symbol is used to negative the result of a expression and force the result to take a boolean value. Examples :
x = !(5 > 2)
In this case, the '!' symbol changes the
greater (>) symbol to
(<=) (Less or equal)
x = !(!(10))
This expression is equal to
x = (10 != 0)
You can negative some of comparison symbols, E.g :
x = (5 !!= 5)
Similar expression :
x = (5 == 5)
x = (5 !> 5)
Similar expression :
x = (5 <= 5)
Also I've just successfully added
[type-casting] feature. IMO it is a way which converts a variable of one type, such as an int, a double,... to an another variable type, For E.g float->int...
Currently I included
unsigned, signed, char, bool, int. The default definition is
float. And, if you choose
unsigned without changing the variable type, the machine will automatically convert the value to
unsigned (Keeps the decimal value). Otherwise, if the value needs to convert, the machine will convert to a proper value with its correspond type.
Here's how :
Let's take a look :
1 2 3 4 5
|
x = 100 + [unsigned]- 57.35 //(1)
x = 100 + [unsigned int]- 57.35 //(2)
x = 100 + [int](3.64 - 2.46) //(3)
x = 100 + [int](3.64 - [bool](2.34 + 3)) //(4)
x = [int](100 / 6) // (5)
|
First of all the first case the tag
[unsigned] converts the value "
-57.35" -> "
57.35"
- Second : Same here, but it converts "
-57.35" -> "
57"
- Third : The [int] tag converts the final result of the expression
(3.64 - 2.46) to a regular integer value.
- Fourth : Converts the final result of the expression
(2.34 + 3) to a boolean value.
- Fifth : The exact value is
16.6666666... But the [int] tag truncates the decimal result, generates
"17", not
"16" as the value of the default C++ type-casting.
What do you think? Any suggestion or idea? Any mistake? :)