714 |
|
|
715 |
@c begin (texi-doc-string "guile" "abs") |
@c begin (texi-doc-string "guile" "abs") |
716 |
@deffn {Scheme Procedure} abs x |
@deffn {Scheme Procedure} abs x |
717 |
|
@deffnx {C Function} scm_abs (x) |
718 |
Return the absolute value of @var{x}. |
Return the absolute value of @var{x}. |
719 |
|
|
720 |
|
@var{x} must be a number with zero imaginary part. To calculate the |
721 |
|
magnitude of a complex number, use @code{magnitude} instead. |
722 |
@end deffn |
@end deffn |
723 |
|
|
724 |
@c begin (texi-doc-string "guile" "max") |
@c begin (texi-doc-string "guile" "max") |
751 |
Round the number @var{x} towards infinity. |
Round the number @var{x} towards infinity. |
752 |
@end deffn |
@end deffn |
753 |
|
|
754 |
|
For the @code{truncate} and @code{round} procedures, the Guile library |
755 |
|
exports equivalent C functions, but taking and returning arguments of |
756 |
|
type @code{double} rather than the usual @code{SCM}. |
757 |
|
|
758 |
|
@deftypefn {C Function} double scm_truncate (double x) |
759 |
|
@deftypefnx {C Function} double scm_round (double x) |
760 |
|
@end deftypefn |
761 |
|
|
762 |
|
For @code{floor} and @code{ceiling}, the equivalent C functions are |
763 |
|
@code{floor} and @code{ceil} from the standard mathematics library |
764 |
|
(which also take and return @code{double} arguments). |
765 |
|
|
766 |
|
|
767 |
@node Scientific |
@node Scientific |
768 |
@subsection Scientific Functions |
@subsection Scientific Functions |
971 |
Return the hyperbolic arctangent of @var{x}. |
Return the hyperbolic arctangent of @var{x}. |
972 |
@end deffn |
@end deffn |
973 |
|
|
974 |
|
For the hyperbolic arc-functions, the Guile library exports C functions |
975 |
|
corresponding to these Scheme procedures, but taking and returning |
976 |
|
arguments of type @code{double} rather than the usual @code{SCM}. |
977 |
|
|
978 |
|
@deftypefn {C Function} double scm_asinh (double x) |
979 |
|
@deftypefnx {C Function} double scm_acosh (double x) |
980 |
|
@deftypefnx {C Function} double scm_atanh (double x) |
981 |
|
Return the hyperbolic arcsine, arccosine or arctangent of @var{x} |
982 |
|
respectively. |
983 |
|
@end deftypefn |
984 |
|
|
985 |
|
For all the other Scheme procedures above, except @code{expt} and |
986 |
|
@code{atan2} (whose entries specifically mention an equivalent C |
987 |
|
function), the equivalent C functions are those provided by the standard |
988 |
|
mathematics library. The mapping is as follows. |
989 |
|
|
990 |
|
@multitable {xx} {Scheme Procedure} {C Function} |
991 |
|
@item @tab Scheme Procedure @tab C Function |
992 |
|
|
993 |
|
@item @tab @code{$abs} @tab @code{fabs} |
994 |
|
@item @tab @code{$sqrt} @tab @code{sqrt} |
995 |
|
@item @tab @code{$sin} @tab @code{sin} |
996 |
|
@item @tab @code{$cos} @tab @code{cos} |
997 |
|
@item @tab @code{$tan} @tab @code{tan} |
998 |
|
@item @tab @code{$asin} @tab @code{asin} |
999 |
|
@item @tab @code{$acos} @tab @code{acos} |
1000 |
|
@item @tab @code{$atan} @tab @code{atan} |
1001 |
|
@item @tab @code{$exp} @tab @code{exp} |
1002 |
|
@item @tab @code{$log} @tab @code{log} |
1003 |
|
@item @tab @code{$sinh} @tab @code{sinh} |
1004 |
|
@item @tab @code{$cosh} @tab @code{cosh} |
1005 |
|
@item @tab @code{$tanh} @tab @code{tanh} |
1006 |
|
@end multitable |
1007 |
|
|
1008 |
|
@noindent |
1009 |
|
Naturally, these C functions expect and return @code{double} arguments. |
1010 |
|
|
1011 |
|
|
1012 |
@node Bitwise Operations |
@node Bitwise Operations |
1013 |
@subsection Bitwise Operations |
@subsection Bitwise Operations |