Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > Re: cot, sec, c...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 9 Topic 4194 of 4250
Post > Topic >>

Re: cot, sec, csc?

by "Sleipnir" <sleipnir.the.white@[EMAIL PROTECTED] > Jul 13, 2008 at 12:23 PM

I think adding the famous "inline" front of each declaration could be
better 
;)






"Richard Heathfield" <rjh@[EMAIL PROTECTED]
> a écrit dans le message de 
news:eaKdnWNZON7KyO_VnZ2dnUVZ8uudnZ2d@[EMAIL PROTECTED]
> Jerry Coffin said:
>
>> In article <tdWdnW1LKtJm0u_VnZ2dnUVZ_rrinZ2d@[EMAIL PROTECTED]
>,
>> pkelecy@[EMAIL PROTECTED]
 says...
>>> Are cot, sec, and csc not a standard part of the math.h?
>>
>> No, they are not.
>
> They are, however, easy to implement naively:
>
> #include <math.h>
>
> double cot(double z)
> {
>  return 1.0 / tan(z);
> }
>
> double sec(double z)
> {
>  return 1.0 / cos(z);
> }
>
> double csc(double z)
> {
>  return 1.0 / sin(z);
> }
>
> Naturally, a more robust implementation would deal with range and domain
> errors.
>
> -- 
> Richard Heathfield <http://www.cpax.org.uk>
> Email: -http://www.
+rjh@[EMAIL PROTECTED]
> Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
> "Usenet is a strange place" - dmr 29 July 1999
 




 9 Posts in Topic:
cot, sec, csc?
Pat <pkelecy@[EMAIL PR  2008-07-07 13:19:02 
Re: cot, sec, csc?
Jerry Coffin <jcoffin@  2008-07-07 11:22:27 
Re: cot, sec, csc?
Richard Heathfield <rj  2008-07-07 17:46:25 
Re: cot, sec, csc?
Pat <pkelecy@[EMAIL PR  2008-07-07 14:09:53 
Re: cot, sec, csc?
"Sleipnir" <  2008-07-13 12:23:33 
Re: cot, sec, csc?
Richard Heathfield <rj  2008-07-13 05:28:28 
Re: cot, sec, csc?
"osmium" <r1  2008-07-13 07:28:11 
Re: cot, sec, csc?
Richard Heathfield <rj  2008-07-13 14:52:01 
Re: cot, sec, csc?
Pat <pkelecy@[EMAIL PR  2008-07-07 14:03:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 28 5:31:48 CDT 2008.