Source File
atoc.go
Belonging Package
strconv
package strconv
const fnParseComplex = "ParseComplex"
func ( string, int) (complex128, error) {
:= 64
if == 64 {
= 32 // complex64 uses float32 parts
}
:=
, , := parseFloatPrefix(, )
if != nil {
, = convErr(, )
if != nil {
return 0,
}
}
= [:]
switch [0] {
if len() > 1 && [1] != '+' {
= [1:]
}
if len() == 1 {
return complex(0, ),
}
fallthrough
default:
return 0, syntaxError(fnParseComplex, )
}
, , := parseFloatPrefix(, )
if != nil {
, = convErr(, )
if != nil {
return 0,
}
}
= [:]
if != "i" {
return 0, syntaxError(fnParseComplex, )
}
return complex(, ),
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |