Skip to content

Modern Math CCot

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › CCot

CCot

Returns the cotangent of a complex number, one over the tangent.

Syntax

CCot( byref z as Complex ) as Complex

Notes

  • CReciprocal( CTan( z ) ), so it inherits CTan's overflow guard.
  • Approaches ∓i for a large imaginary part, which is where the guard earns itself.

Examples

#import "std/numeric"
using numeric

dim as Complex z = CSet( 0.5, 0.25 )

print CToString( CCot( z ) )               '' 1.432721075387994-0.8872370407840959i
print CToString( CCot( CSet( 1, 750 ) ) )  '' 0-1i   -- finite, heading for -i

Library: Math Library
Category: Math Library
Documented under: Members

Clone this wiki locally