Skip to content

Modern Math CImaginaryOne

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

Home › Math Library › Math Library › CImaginaryOne

CImaginaryOne

Returns the imaginary unit i.

Syntax

CImaginaryOne( ) as Complex

Notes

  • i² = -1 exactly — no rounding, because the four-multiply form of * produces (0·0 - 1·1, 0·1 + 1·0).
  • Multiplying by i is a quarter turn anticlockwise, which is why several bodies in this header rotate by hand rather than calling out to a multiply.

Examples

#import "std/numeric"
using numeric

print CToString( CImaginaryOne( ) )                     '' 0+1i
print CToString( CImaginaryOne( ) * CImaginaryOne( ) )  '' -1+0i   -- exactly -1

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

Clone this wiki locally