Saturday 30 January 2016

Julia: Arithmetic operators

Julia support following arithmetic operators.
Operator
Performs
+
Addition
-
Subtraction. –x is used to negate value x.
*
Multiplication
/
Division
\
It is inverse of division x/y is equivalent of y\x
^
Power. X^Y calculates X to the power Y.
%
Remainder.



julia> a=10;b=20;

julia> a+b
30

julia> a-b
-10

julia> a*b
200

julia> a/b
0.5

julia> a%b
10

julia> a\b
2.0

julia> a^b
7766279631452241920

julia> -b
-20

julia> b
20





Previous                                                 Next                                                 Home

No comments:

Post a Comment