From: Kevin Ryde <user42@zip.com.au>
Subject: doco primitive numerics C funcs
Date: Sat, 07 Jun 2003 08:24:09 +1000 [thread overview]
Message-ID: <87znku26ba.fsf@zip.com.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]
* scheme-data.texi (Primitive Numerics): Add atan2, pow, asinh, acosh
and atanh to scheme<->C table. Note asinh, acosh and atanh are C99,
and scm_asinh, scm_acosh and scm_atanh are equivalents. Cross ref
glibc "Mathematics". Reword this end part for clarity.
I think it's clearer to have the scheme<->C table first, then the
extra inverse-hyperbolics.
I found the bit
except `expt' and `atan2' (whose entries specifically mention
an equivalent C function)
a little unclear. I thought it was saying there were C "double"
functions mentioned, where instead it's SCM functions. I think this
can be quietly dropped now $expt<->pow and $atan2<->atan2 are in the
table.
For ease of contemplation, the end part proposed is,
C functions for the above are provided by the standard mathematics
library. Naturally these expect and return `double' arguments (*note
Mathematics: (libc)Mathematics.).
Scheme Procedure C Function
`$abs' `fabs'
`$sqrt' `sqrt'
`$sin' `sin'
`$cos' `cos'
`$tan' `tan'
`$asin' `asin'
`$acos' `acos'
`$atan' `atan'
`$atan2' `atan2'
`$exp' `exp'
`$expt' `pow'
`$log' `log'
`$sinh' `sinh'
`$cosh' `cosh'
`$tanh' `tanh'
`$asinh' `asinh'
`$acosh' `acosh'
`$atanh' `atanh'
`asinh', `acosh' and `atanh' are C99 standard but might not be
available on older systems. Guile provides the following equivalents
(on all systems).
- C Function: double scm_asinh (double x)
- C Function: double scm_acosh (double x)
- C Function: double scm_atanh (double x)
Return the hyperbolic arcsine, arccosine or arctangent of X
respectively.
[-- Attachment #2: scheme-data.texi.primitive-numerics.diff --]
[-- Type: text/plain, Size: 2415 bytes --]
--- scheme-data.texi.~1.30.~ 2003-05-24 09:49:12.000000000 +1000
+++ scheme-data.texi 2003-06-06 11:48:39.000000000 +1000
@@ -1014,21 +1014,9 @@
Return the hyperbolic arctangent of @var{x}.
@end deffn
-For the hyperbolic arc-functions, the Guile library exports C functions
-corresponding to these Scheme procedures, but taking and returning
-arguments of type @code{double} rather than the usual @code{SCM}.
-
-@deftypefn {C Function} double scm_asinh (double x)
-@deftypefnx {C Function} double scm_acosh (double x)
-@deftypefnx {C Function} double scm_atanh (double x)
-Return the hyperbolic arcsine, arccosine or arctangent of @var{x}
-respectively.
-@end deftypefn
-
-For all the other Scheme procedures above, except @code{expt} and
-@code{atan2} (whose entries specifically mention an equivalent C
-function), the equivalent C functions are those provided by the standard
-mathematics library. The mapping is as follows.
+C functions for the above are provided by the standard mathematics
+library. Naturally these expect and return @code{double} arguments
+(@pxref{Mathematics,,, libc, GNU C Library Reference Manual}).
@multitable {xx} {Scheme Procedure} {C Function}
@item @tab Scheme Procedure @tab C Function
@@ -1041,15 +1029,28 @@
@item @tab @code{$asin} @tab @code{asin}
@item @tab @code{$acos} @tab @code{acos}
@item @tab @code{$atan} @tab @code{atan}
+@item @tab @code{$atan2} @tab @code{atan2}
@item @tab @code{$exp} @tab @code{exp}
+@item @tab @code{$expt} @tab @code{pow}
@item @tab @code{$log} @tab @code{log}
@item @tab @code{$sinh} @tab @code{sinh}
@item @tab @code{$cosh} @tab @code{cosh}
@item @tab @code{$tanh} @tab @code{tanh}
+@item @tab @code{$asinh} @tab @code{asinh}
+@item @tab @code{$acosh} @tab @code{acosh}
+@item @tab @code{$atanh} @tab @code{atanh}
@end multitable
-@noindent
-Naturally, these C functions expect and return @code{double} arguments.
+@code{asinh}, @code{acosh} and @code{atanh} are C99 standard but might
+not be present on older systems. Guile provides the following
+equivalents (on all systems).
+
+@deftypefn {C Function} double scm_asinh (double x)
+@deftypefnx {C Function} double scm_acosh (double x)
+@deftypefnx {C Function} double scm_atanh (double x)
+Return the hyperbolic arcsine, arccosine or arctangent of @var{x}
+respectively.
+@end deftypefn
@node Bitwise Operations
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2003-06-06 22:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-06 22:24 Kevin Ryde [this message]
2003-06-11 22:58 ` doco primitive numerics C funcs Kevin Ryde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87znku26ba.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).