Skip to content

Modern Math CSetReal

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

Home › Math Library › Math Library › CSetReal

CSetReal

Sets the real part of a complex variable in place.

Syntax

CSetReal( byref z as Complex, byval x as float64 )

Notes

  • A sub, not a function: it modifies its argument and returns nothing.
  • z.re = x does the same thing. This exists so that code written against the accessors does not have to reach for the field on the one occasion it assigns.

Examples

#import "std/numeric"
using numeric

dim as Complex z = CSet( 3, 4 )
CSetReal( z, 9 )

print CToString( z )  '' 9+4i   -- after CSetReal( z, 9 )

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

Clone this wiki locally