File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22!
33! The Fortran standard specifies the availability of:
44!
5- ! - `cosd` and `sind`, which operate on degrees and real(4) types ( Fortran 23 ).
5+ ! - `cosd` and `sind`, which operate on degrees and real type (Draft Fortran 2023: 16.9.62; 16.9.191 ).
66! - `dcos` and `dsin`, which operate on radians and real(8) types (Fortran 77).
77!
88! To replace `dcosd` and `dsind`, let's convert from degrees to radians
@@ -20,13 +20,13 @@ module trigonometric_utils
2020 real (kind= c_double) function dcosd(degrees)
2121 real (kind= c_double), intent (in ) :: degrees
2222 ! `dcos` expects the angle to be in radians, not degrees
23- dcosd = dcos(degrees * pi / 180.0 )
23+ dcosd = dcos(degrees * pi / 180.0_c_double )
2424 end function dcosd
2525
2626 real (kind= c_double) function dsind(degrees)
2727 real (kind= c_double), intent (in ) :: degrees
2828 ! `dsin` expects the angle to be in radians, not degrees
29- dsind = dsin(degrees * pi / 180.0 )
29+ dsind = dsin(degrees * pi / 180.0_c_double )
3030 end function dsind
3131end module trigonometric_utils
3232
You can’t perform that action at this time.
0 commit comments