JuliaLang/julia

Printf for complex numbers

Aperta

#58.617 aperta il 3 giu 2025

 (4 commenti) (0 reazioni) (0 assegnatari)Julia (5773 fork)batch import
complexdisplay and printingfeaturehelp wanted

Metriche repository

Star
 (48.709 stelle)
Metriche merge PR
 (Merge medio 20g 6h) (157 PR mergiate in 30 g)

Descrizione

Currently, @sprintf "%.2f" (1+2im) errors, but it would make sense for it to produce "1.00 + 2.00im" I think. Currently, printfing a complex number is not really convenient, requiring a manual split into real + complex, and keeping the format string in sync between them.

Guida contributor