github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/strconv/ctoa.go (about)

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package strconv
     6  
     7  // FormatComplexは複素数cを,(a+bi)という形式の文字列に変換します.ここでaとbは実部と虚部を表し,フォーマットfmtと精度precに従って整形されます.
     8  //
     9  // フォーマットfmtと精度precは,FormatFloatの意味と同じです.元の値がcomplex64の場合はbitSizeが64で,complex128の場合は128であることを前提にして結果を丸めます.
    10  func FormatComplex(c complex128, fmt byte, prec, bitSize int) string