Skip to content

Modern Math CSetImag

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

Home › Math Library › Math Library › CSetImag

CSetImag

Sets the imaginary part of a complex variable in place.

Syntax

CSetImag( byref z as Complex, byval y as float64 )

Notes

  • A sub, not a function — see CSetReal.
  • y is the coefficient of i, so CSetImag( z, 4 ) makes the imaginary part 4i.

Examples

#import "std/numeric"
using numeric

dim as Complex z = CSet( 3, 4 )
CSetImag( z, -2 )

print CToString( z )  '' 3-2i   -- after CSetImag( z, -2 )

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

Clone this wiki locally