package jx

import (
	
	

	
)

// BigFloat read big.Float
func ( *Decoder) () (*big.Float, error) {
	,  := .numberAppend(nil)
	if  != nil {
		return nil, errors.Wrap(, "number")
	}
	 := 64
	if len() >  {
		 = len()
	}
	, ,  := big.ParseFloat(string(), 10, uint(), big.ToZero)
	if  != nil {
		return nil, errors.Wrap(, "float")
	}
	return , nil
}

// BigInt read big.Int
func ( *Decoder) () (*big.Int, error) {
	,  := .numberAppend(nil)
	if  != nil {
		return nil, errors.Wrap(, "number")
	}
	 := big.NewInt(0)
	var  bool
	if ,  = .SetString(string(), 10); ! {
		return nil, errors.New("invalid")
	}
	return , nil
}

func ( *Decoder) () ([]byte, error) {
	 := .head
	 := .buf[.head:.tail]
	for ,  := range  {
		switch floatDigits[] {
		case invalidCharForNumber:
			return nil, badToken(, .offset()+)
		case endOfNumber:
			// End of number.
			.head += 
			return .buf[:.head], nil
		default:
			continue
		}
	}
	// Buffer is number within head:tail.
	.head = .tail
	return .buf[:.tail], nil
}

func ( *Decoder) ( []byte) ([]byte, error) {
	for {
		,  := .number()
		if  != nil {
			return nil, 
		}

		 = append(, ...)
		if .head != .tail {
			return , nil
		}

		if  := .read();  != nil {
			if  == io.EOF {
				return , nil
			}
			return , 
		}
	}
}