Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

source code for sin() in FORTRAN

I want to know how the build-in function sin() is implemented in FORTRAN, because I try to write functions that can receive both scalars and array as its input variable, the effect of which can be found in sin(), that sin(0) returns 0 and sin(a), where array a=(/0,3.14...), returns an array (0,0).

I hope all mathematical functions I am gonna write can have this kind of flexibility and advantage. Someone could do me a favor?

like image 711
booksee Avatar asked Dec 05 '25 13:12

booksee


1 Answers

You can make an elemental function

like image 126
mgilson Avatar answered Dec 07 '25 15:12

mgilson