

|
 |
| << 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:
|
Pat <pkelecy@[EMAIL PR |
2008-07-07 13:19:02 |
|
Jerry Coffin <jcoffin@ |
2008-07-07 11:22:27 |
|
Richard Heathfield <rj |
2008-07-07 17:46:25 |
|
Pat <pkelecy@[EMAIL PR |
2008-07-07 14:09:53 |
|
"Sleipnir" < |
2008-07-13 12:23:33 |
|
Richard Heathfield <rj |
2008-07-13 05:28:28 |
|
"osmium" <r1 |
2008-07-13 07:28:11 |
|
Richard Heathfield <rj |
2008-07-13 14:52:01 |
|
Pat <pkelecy@[EMAIL PR |
2008-07-07 14:03:55 |
|
Post A Reply:

|
|
|
|