From: Taylor R Campbell Date: Sun, 30 Jun 2019 19:06:04 +0000 (+0000) Subject: Document copysign. X-Git-Tag: mit-scheme-pucked-10.1.12~7^2~33 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ca82978311908c30227e1c5c2436bde49445a18a;p=mit-scheme.git Document copysign. --- diff --git a/doc/ref-manual/numbers.texi b/doc/ref-manual/numbers.texi index 6cf04083c..1b592d274 100644 --- a/doc/ref-manual/numbers.texi +++ b/doc/ref-manual/numbers.texi @@ -1298,6 +1298,20 @@ inexact numbers are representable as exact numbers. The procedure @code{inexact->exact} has been deprecated by @urseven{}. @end deffn +@deffn procedure copysign x1 x2 +Returns a real number with the magnitude of @var{x1} and the sign of +@var{x2}. + +@example +@group +(copysign 123 -1) @result{} -123 +(copysign 0. -1) @result{} -0. +(copysign -0. 0.) @result{} 0. +(copysign -nan.123 0.) @result{} +nan.123 +@end group +@end example +@end deffn + @node Numerical input and output, Fixnum and Flonum Operations, Numerical operations, Numbers @section Numerical input and output @cindex numerical input and output