Skip to content

[BUG]大数解析报错 #2672

@raychow

Description

@raychow

问题描述

fastjson2 2.0.51

JSON.parseObject("{\"token\": 2.105465717176397390012604E+1294}");

报错:
Exception in thread "main" com.alibaba.fastjson2.JSONException: too large exp value : 1294
at com.alibaba.fastjson2.JSONReaderUTF8.readNumber0(JSONReaderUTF8.java:5458)
at com.alibaba.fastjson2.JSONReader.readNumber(JSONReader.java:1004)
at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:2087)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:348)

在 fastjson1 中 token 可被解析为 BigDecimal

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions