Skip to content

Modern Math CSwap

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

Home › Math Library › Math Library › CSwap

CSwap

Swaps the values of two complex variables.

Syntax

CSwap( byref a as Complex, byref b as Complex )

Notes

  • A sub. Both arguments are modified.
  • The swap statement does the same for two Complex variables; this exists so that the operation has a name in the same family as the rest.

Examples

#import "std/numeric"
using numeric

dim as Complex a = CSet( 1, 2 ), b = CSet( 5, 6 )
CSwap( a, b )

print CToString( a )  '' 5+6i   -- after the swap
print CToString( b )  '' 1+2i

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

Clone this wiki locally