From: analyst41 on 15 Oct 2009 21:08 (1) Using Double Precision for latitude and longitude and using double precision for degrees to radians and radius of the earth (by the way, I have seen values that differ by about 4 miles) (2) checking argument of acos to be between -1 and 1 Seems to be working OK. Are the generic sin,cos and acos functions sufficient? Have functions such as DCOS become unnecessary in f95? Thanks for any responses.
From: steve on 15 Oct 2009 21:17 On Oct 15, 6:08 pm, analys...(a)hotmail.com wrote: > (1) Using Double Precision for latitude and longitude and using double > precision for degrees to radians and radius of the earth (by the way, > I have seen values that differ by about 4 miles) > > (2) checking argument of acos to be between -1 and 1 > > Seems to be working OK. > > Are the generic sin,cos and acos functions sufficient? Yes. (Of course, you failed to note the accuracy to which you know your input parameters. If you have more that 17 decimal digits of precision and you want more than 17 decimal digits, then DOUBLE PRECISION (assuming IEEE binary64 format) is not sufficient.) > > Have functions such as DCOS become unnecessary in f95? > Yes.
From: glen herrmannsfeldt on 15 Oct 2009 21:48 analyst41(a)hotmail.com wrote: > Are the generic sin,cos and acos functions sufficient? > Have functions such as DCOS become unnecessary in f95? Functions like DCOS are still part of the standard, but have few uses. One is that they allow older programs to still compile without changes. Another is that they can be passed as actual arguments, but the generics can't. That is rarely useful, though, as the common usage for passing functions as arguments of for integration and minimization routines, but integrating or finding the minima of DCOS isn't very useful. -- glen
From: Richard Maine on 15 Oct 2009 22:45 steve <kargls(a)comcast.net> wrote: > On Oct 15, 6:08 pm, analys...(a)hotmail.com wrote: > > Have functions such as DCOS become unnecessary in f95? > > > Yes. I'd say no.... But only because it was in f77 that they became superfluous. :-) They are remnants of f66. -- Richard Maine | Good judgment comes from experience; email: last name at domain . net | experience comes from bad judgment. domain: summertriangle | -- Mark Twain
From: steve on 15 Oct 2009 23:09 On Oct 15, 7:45 pm, nos...(a)see.signature (Richard Maine) wrote: > steve <kar...(a)comcast.net> wrote: > > On Oct 15, 6:08 pm, analys...(a)hotmail.com wrote: > > > Have functions such as DCOS become unnecessary in f95? > > > Yes. > > I'd say no.... > > But only because it was in f77 that they became superfluous. :-) > > They are remnants of f66. > For moment, I thought you were disagreeing with me. Thankfully, the smiley alerted me to your intent. I do note that Glen has point out that DCOS is needed for passing a specific cosine function to a subprogram as an actual argument. -- steve
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Integer return values in interfaces Next: Cannot mex with gfortran on Snow Leopard (64bit) |