# HG changeset patch # User Michael Godfrey # Date 1348624424 14400 # Node ID 0b6c29cb53d009139766f79709c7c3c8db24320a # Parent 015cc3d1f38980a204bf5fc62c6c884e691baed3 Update trig function doc diff --git a/doc/interpreter/arith.txi b/doc/interpreter/arith.txi --- a/doc/interpreter/arith.txi +++ b/doc/interpreter/arith.txi @@ -118,6 +118,20 @@ example, @code{sin} expects an angle in radians while @code{sind} expects an angle in degrees. +Octave uses the C library trigonometric functions. It is expected that these +functions are defined by the ISO/IEC 9899 standard. This Standard is available +at: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf. Section F.9.1 deals +with the trigonometric functions. The behavior of most of the functions is +relatively straightforward. However, there are some exceptions to the standard +behavior. Many of the exceptions involve the behavior for -0. +The most complex case is atan2. Octave exactly implements the behavior given +in the Standard. Including @tex $atan2(\pm0, -0)$ @end tex @ifnottex @code +{atan2(+- 0, 0)} @end ifnottex +returns @tex $\pm \pi.$@end tex @ifnottex @code{+- pi}. + +It should be noted that Matlab uses different definitions which apparently +do not distinguish -0. + @DOCSTRING(sin) @DOCSTRING(cos) @DOCSTRING(tan)