Re: Angle Units For Trig Functions

Liste des GroupesRevenir à cl fortran 
Sujet : Re: Angle Units For Trig Functions
De : sgk (at) *nospam* REMOVEtroutmask.apl.washington.edu (Steven G. Kargl)
Groupes : comp.lang.fortran
Date : 20. Oct 2024, 06:35:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vf24qs$9mgr$1@dont-email.me>
References : 1
User-Agent : Pan/0.145 (Duplicitous mercenary valetism; d7e168a git.gnome.org/pan2)
On Sun, 20 Oct 2024 03:47:13 +0000, Lawrence D'Oliveiro wrote:

I see that the Fortran 2023 spec has added a bunch of parallel trig
functions that work in degrees.

No. Fortran does not contain "a bunch of parallel trig functions
that work in degrees."  It contains a bunch of elemental functions.

I find this sort of thing unnecessary. It seems conventional to add
functions for converting between degrees and radians, but a simpler way is
to simply define a conversion factor for each angle unit. One conversion
factor is simpler than two functions for each angle unit.

program foo
   real x, y
   x = 30+360*1111
   y = x * (4 * atan(1.) / 180)
   print *, sind(x), sin(y)
end program foo

% gfcx -o z a.f90 && ./z
0.500000000      0.500089288

One of these values is exact, and one of these raises FE_INEXACT.

--
steve

Date Sujet#  Auteur
20 Oct 24 * Angle Units For Trig Functions26Lawrence D'Oliveiro
20 Oct 24 +- Re: Angle Units For Trig Functions1yeti
20 Oct 24 `* Re: Angle Units For Trig Functions24Steven G. Kargl
22 Oct 24  `* Re: Angle Units For Trig Functions23Lawrence D'Oliveiro
22 Oct 24   +* Re: Angle Units For Trig Functions5Steven G. Kargl
22 Oct 24   i`* Re: Angle Units For Trig Functions4Lawrence D'Oliveiro
23 Oct 24   i `* Re: Angle Units For Trig Functions3Steven G. Kargl
23 Oct 24   i  `* Re: Angle Units For Trig Functions2Lawrence D'Oliveiro
23 Oct 24   i   `- Re: Angle Units For Trig Functions1Steven G. Kargl
23 Oct 24   `* Re: Angle Units For Trig Functions17Lawrence D'Oliveiro
23 Oct 24    `* Re: Angle Units For Trig Functions16David Jones
23 Oct 24     `* Re: Angle Units For Trig Functions15Lawrence D'Oliveiro
23 Oct 24      `* Re: Angle Units For Trig Functions14R Daneel Olivaw
23 Oct 24       `* Re: Angle Units For Trig Functions13Lawrence D'Oliveiro
23 Oct 24        `* Re: Angle Units For Trig Functions12Steven G. Kargl
23 Oct 24         `* Re: Angle Units For Trig Functions11Neil
24 Oct 24          +- Re: Angle Units For Trig Functions1Steven G. Kargl
24 Oct 24          +* Re: Angle Units For Trig Functions8Lawrence D'Oliveiro
24 Oct 24          i+* Re: Angle Units For Trig Functions6Steven G. Kargl
24 Oct 24          ii`* Re: Angle Units For Trig Functions5Lawrence D'Oliveiro
24 Oct 24          ii `* Re: Angle Units For Trig Functions4Steven G. Kargl
24 Oct 24          ii  `* Re: Angle Units For Trig Functions3Lawrence D'Oliveiro
24 Oct 24          ii   `* Re: Angle Units For Trig Functions2Steven G. Kargl
24 Oct 24          ii    `- Re: Angle Units For Trig Functions1Lawrence D'Oliveiro
24 Oct 24          i`- Re: Angle Units For Trig Functions1Lawrence D'Oliveiro
24 Oct 24          `- Re: Angle Units For Trig Functions1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal