JuliaLang/julia

Printf for complex numbers

開放

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

 (4 則留言) (0 個反應) (0 位負責人)Julia (5,773 個分叉)batch import
complexdisplay and printingfeaturehelp wanted

倉庫指標

星標
 (48,709 顆星)
PR 合併指標
 (平均合併 20天 6小時) (30 天內合併 157 個 PR)

描述

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.

貢獻者指南