You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
has syntax check and return an error if s is empty or contains invalid digits.
has range check and return the the closest number among the range if overflow.
// The errors that ParseInt returns have concrete type *NumError
// and include err.Num = s. If s is empty or contains invalid
// digits, err.Err = ErrSyntax and the returned value is 0;
// if the value corresponding to s cannot be represented by a
// signed integer of the given size, err.Err = ErrRange and the
// returned value is the maximum magnitude integer of the
// appropriate bitSize and sign.
func ParseInt(s string, base int, bitSize int) (i int64, err error) {
I need these but fastjson.ParseInt64BestEffort behaves differently.
The text was updated successfully, but these errors were encountered:
yuzhichang
changed the title
range check when parsing integers
compatibility with strconv.ParseInt
May 16, 2021
The
strconv.ParseInt
in Golang std libI need these but
fastjson.ParseInt64BestEffort
behaves differently.The text was updated successfully, but these errors were encountered: