github.com/zerosnake0/jzon@v0.0.9-0.20230801092939-1b135cb83f7f/iterator_float.go (about)

     1  package jzon
     2  
     3  const (
     4  	invalidFloatDigit = -1
     5  	dotInNumber       = -2
     6  	expInNumber       = -3
     7  )
     8  
     9  var (
    10  	floatDigits [charNum]int8
    11  )
    12  
    13  func init() {
    14  	for i := 0; i < charNum; i++ {
    15  		floatDigits[i] = invalidFloatDigit
    16  	}
    17  	for i := '0'; i <= '9'; i++ {
    18  		floatDigits[i] = int8(i - '0')
    19  	}
    20  	floatDigits['.'] = dotInNumber
    21  	floatDigits['e'] = expInNumber
    22  	floatDigits['E'] = expInNumber
    23  }