Deutsch   English   Français   Italiano  
<vf24qs$9mgr$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu>
Newsgroups: comp.lang.fortran
Subject: Re: Angle Units For Trig Functions
Date: Sun, 20 Oct 2024 05:35:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <vf24qs$9mgr$1@dont-email.me>
References: <vf1ug0$8qpm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 20 Oct 2024 07:35:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5dfd83c723f006fba6669f937f817529";
	logging-data="317979"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+7K6+WxyOzaHEQo2kYe+0F"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
 git.gnome.org/pan2)
Cancel-Lock: sha1:Crqi8jvuIqNbJofvvTKGnwUmkzc=
Bytes: 1879

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