unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* doco primitive numerics C funcs
@ 2003-06-06 22:24 Kevin Ryde
  2003-06-11 22:58 ` Kevin Ryde
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2003-06-06 22:24 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: doco primitive numerics C funcs
  2003-06-06 22:24 doco primitive numerics C funcs Kevin Ryde
@ 2003-06-11 22:58 ` Kevin Ryde
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2003-06-11 22:58 UTC (permalink / raw)


I wrote:
>
>         * 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 made this change.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-11 22:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-06 22:24 doco primitive numerics C funcs Kevin Ryde
2003-06-11 22:58 ` Kevin Ryde

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).