julia fit 函数
Julia| abs2()函数 (Julia | abs2() function)
abs2() function is a library function in Julia programming language, it is used to get the squared absolute value of the given signed integer.
abs2()函数是Julia编程语言中的库函数,用于获取给定有符号整数的平方绝对值。
Syntax:
句法:
abs2(val)
Parameter(s):
参数:
val – represents a signed integer/value, whose squared absolute value to be found.
val –表示一个有符号的整数/值,其平方的绝对值将被找到。
Return value:
返回值:
The return type of this method is Int64, it returns the squared absolute value of val.
此方法的返回类型为Int64 ,它返回val的平方绝对值。
Example:
例:
Input:
val = 0
Output:
abs2(val): 0
Input:
val = -10
Output:
abs2(val): 100
Input:
val = 10
abs2(val): 100
Program:
程序:
# abs2() Function with Example in Julia
val = 0
println("val: ", val)
println("abs2(val): ", abs2(val))
val = 10
println("val: ", val)
println("abs2(val): ", abs2(val))
val = -10
println("val: ", val)
println("abs2(val): ", abs2(val))
val = 10.23
println("val: ", val)
println("abs2(val): ", abs2(val))
val = -10.23
println("val: ", val)
println("abs2(val): ", abs2(val))
# printing the return type of abs2()
println("typeof(abs2(-10)): ", typeof(abs2(-10)))
Output
输出量
val: 0
abs2(val): 0
val: 10
abs2(val): 100
val: -10
abs2(val): 100
val: 10.23
abs2(val): 104.6529
val: -10.23
abs2(val): 104.6529
typeof(abs2(-10)): Int64
翻译自: https://www.includehelp.com/julia/abs2-function-with-example.aspx
julia fit 函数