Getting square root of a number in Julia - sqrt() and isqrt() Methods Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report The sqrt() is an inbuilt function in julia which is used to return the square root of the specified number and throws DomainError for negative Real parameter. It also accept complex negative parameter. Syntax: sqrt(x) Parameters: x: Specified values. Returns: It returns the square root of the specified number and throws DomainError for negative Real parameter. It also accept complex negative parameter. Example: Python # Julia program to illustrate # the use of sqrt() method # Getting the square root of the # specified number and throws DomainError # for negative Real parameter println(sqrt(9)) println(sqrt(16)) println(sqrt(complex(-25))) println(sqrt(-49)) Output: 3.0 4.0 0.0 + 5.0im ERROR: LoadError: DomainError: sqrt will only return a complex result if called with a complex argument. Try sqrt(complex(x)). Stacktrace: [1] sqrt(::Int64) at ./math.jl:434 while loading /home/cg/root/9093667/main.jl, in expression starting on line 10 isqrt() The isqrt() is an inbuilt function in julia which is used to return integer square root of the specified value. The largest returned integer value m(say) such that m*m <= n. Syntax: isqrt(n::Integer) Parameters: n::Integer: Specified values. Returns: It returns integer square root of the specified value. Example: Python # Julia program to illustrate # the use of isqrt() method # Getting integer square root of the specified value. println(isqrt(12)) println(isqrt(17)) println(isqrt(5)) println(isqrt(227)) Output: 3 4 2 15 Comment More infoAdvertise with us Next Article Getting square root of a number in Julia - sqrt() and isqrt() Methods K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads Getting rounded value of a number in Julia - round() Method The round() is an inbuilt function in julia which is used to round the specified number in different ways which are illustrated below- The default round process is done to the nearest integer, with ties (fractional values of 0.5) being rounded to the nearest even integer. The specified value x is ro 2 min read Getting the absolute value of a number in Julia - abs() Method The abs() is an inbuilt function in julia which is used to return the absolute value of the specified number x. Syntax: abs(x) Parameters: x: Specified value. Returns: It returns the absolute value of the specified number x. Example 1: Python # Julia program to illustrate # the use of abs() method # 1 min read Checking type of a number in Julia - isinf(), isnan(), iszero() and isone() Methods The isinf() is an inbuilt function in julia which is used to test whether the specified number is infinite or not. Syntax: isinf(x) Parameters: x: Specified values. Returns: It returns true if the specified number is infinite else false. Example: Python # Julia program to illustrate # the use of isi 2 min read Getting the nearest integral value of x in Julia - trunc() Method The trunc() is an inbuilt function in julia which is used to return the nearest integral value of the same type as the specified value x whose absolute value is less than or equal to x. Syntax: trunc(x) Parameters: x: Specified value. Returns: It returns the nearest integral value of the same type a 1 min read Getting square of absolute value in Julia - abs2() Method 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: x: Specified value. Returns: It returns square of the absolute value of the specified number x. Example 1: Python # Julia program to illustrate # the 1 min read Checking if a number is power of two in Julia - ispow2() Method The ispow2() is an inbuilt function in julia which is used to test whether the specified number n is a power of two or not. Syntax: ispow2(n::Integer) Parameters: n::Integer: Specified number. Returns: It returns true if the given number is power of 2 else false. Example 1: Python # Julia program to 1 min read Getting factorial of a number in Julia - factorial() Method The factorial() is an inbuilt function in julia which is used to return the factorial of the specified number n. Syntax: factorial(n::Integer) Parameters: n: Specified number Returns: It returns the factorial of the specified number n. Example 1: Python # Julia program to illustrate # the use of fac 1 min read Getting sine and hyperbolic sine in Julia - sin(), sinh() and sind() Methods The sin() is an inbuilt function in julia which is used to calculate sine of the specified radian values. Syntax: sin(x) Parameters: x: Specified radian values. Returns: It returns the calculated sine of the specified radian values. Example: Python # Julia program to illustrate # the use of sin() me 2 min read Getting binomial coefficient of a number in Julia - binomial() Method The binomial() is an inbuilt function in julia which is used to return the binomial coefficient $\binom{n}{k}$ which is the coefficient of the kth term in the polynomial expansion of $(1+x)^n$. Its formula is - \[\binom{n}{k} = \frac{n!}{k! (n-k)!}\], where $n!$ is the factorial of n. If n is negati 1 min read Getting the remainder value after division in Julia - mod() Method The mod() is an inbuilt function in julia which is used to return remainder when the specified dividend is divided by divisor. Syntax: mod(x, y) Parameters: x: Specified dividend. y: Specified divisor. Returns: It returns remainder when the specified dividend is divided by divisor. Example 1: Python 1 min read Like