Operators
V supports the following operators:
Basic Operators
+
(addition) for int, float and string-
(subtraction) for int and float*
(multiplication) for int and float/
(division) for int and float%
(modulos) for int=
(assignment) for changing values:=
for initialising values
Output
Note: Unlike other languages, V doesn't allow modulus with float.
Comparison Operators
>
greater than<
lesser than==
equal to>=
greater than or equal to<=
lesser than or equal to!=
not equal to
Boolean Operators
&&
and||
or!
not
Bitwise Operators
<<
left bitshift>>
right bitshift&
bitwise and|
bitwise or^
bitwise xor
Assignments Operators
+=
same asfoo = foo + var
-=
same asfoo = foo - var
*=
same asfoo = foo * var
/=
same asfoo = foo / var
&=
same asfoo = foo & var
|=
same asfoo = foo | var
>>=
same asfoo = foo >> var
<<=
same asfoo = foo << var
Special Operators
in
for membershipnone
for optional
Last updated