JuliaLang/julia

Printf for complex numbers

Open

#58,617 建立於 2025年6月3日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)Julia (48,709 star) (5,773 fork)batch import
complexdisplay and printingfeaturehelp wanted

描述

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.

貢獻者指南