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.

贡献者指南

Printf for complex numbers · JuliaLang/julia#58617 | Good First Issue