Open In App

Different uses of sine function in Julia – sinpi() and sinc() Method

Last Updated : 21 Apr, 2020
Improve
Improve
Like Article
Like
Save
Share
Report
The sinpi() is an inbuilt function in julia which is used to compute the value of $\sin(\pi x)$ which is more accurately than sin(\pi*x), where x is the large value.
Syntax: sinpi(x) Parameters:
  • x: Specified large value.
Returns: It returns the value of $\sin(\pi x)$ which is more accurately than sin(pi*x).
Example:
# Julia program to illustrate 
# the use of sinpi() method
  
# Getting the value of sin(pi x)
println(sinpi(55))
println(sinpi(22.7))
println(sinpi(3.17))
println(sinpi(22 / 7))

                    
Output:
0.0
0.8090169943749488
-0.5090414157503711
-0.43388373911755795

sinc()

The sinc() is an inbuilt function in julia which is used to compute the value of $\sin(\pi x)/(\pi x)$.
Syntax: sinc(x) Parameters:
  • x: Specified value.
Returns: It returns the value of $\sin(\pi x)/(\pi x)$.
Example:
# Julia program to illustrate 
# the use of sinc() method
  
# Getting the value of sin(pi x)/(pi x)
println(sinc(0))
println(sinc(1))
println(sinc(3.14))
println(sinc(22 / 7))

                    
Output:
1
0
-0.043162343260348214
-0.04394392660493417


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads