Getting square of absolute value in Julia – abs2() Method
Last Updated :
21 Apr, 2020
The abs2()
is an inbuilt function in julia which is used to return square of the absolute value of the specified number x.
Syntax: abs2(x)
Parameters:
Returns: It returns square of the absolute value of the specified number x.
Example 1:
println(abs2( 0 ))
println(abs2( 2 ))
println(abs2( - 5 ))
|
Output:
0
4
25
Example 2:
println(abs2( 0 ))
println(abs2( - 2.7 ))
println(abs2( - 2.9 ))
println(abs2( 0.7 ))
println(abs2( - 0.2 ))
println(abs2( 22 ))
|
Output:
0
7.290000000000001
8.41
0.48999999999999994
0.04000000000000001
484
Share your thoughts in the comments
Please Login to comment...