JuliaLang/julia

Printf for complex numbers

Open

#58.617 aperta il 3 giu 2025

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

Metriche repository

Star
 (48.709 star)
Metriche merge PR
 (Merge medio 23g 11h) (145 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