Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.44 数字过长导致负数转换为整数的bug #2128

Closed
org-kepe opened this issue Dec 26, 2023 · 3 comments
Closed

2.0.44 数字过长导致负数转换为整数的bug #2128

org-kepe opened this issue Dec 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working fixed
Milestone

Comments

@org-kepe
Copy link

问题描述

简要描述您碰到的问题。

String str="{\"amt\":-22.1400000000000005684341886080801486968994140625}";
System.out.println(JSONObject.parseObject(str, Map.class));
//输出{amt=22.1400000000000005684341886080801486968994140625}

应该结果是负数的,结果值变了

环境信息

请填写以下信息:

  • OS信息: windows linix
  • JDK信息:1.8
  • 版本信息:2.0.44
@org-kepe org-kepe added the bug Something isn't working label Dec 26, 2023
@wenshao wenshao added this to the 2.0.45 milestone Dec 27, 2023
@yanxutao89 yanxutao89 self-assigned this Dec 27, 2023
@wenshao
Copy link
Member

wenshao commented Dec 29, 2023

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.45-SNAPSHOT/
问题已修复,请帮2.0.45-SNAPSHOT验证问题是否已经修复,我会尽快发布新版本

@wenshao wenshao added the fixed label Dec 29, 2023
@org-kepe
Copy link
Author

问题已修复

@wenshao
Copy link
Member

wenshao commented Jan 7, 2024

https://github.com/alibaba/fastjson2/releases/tag/2.0.45
问题已修复,请用新版本

@wenshao wenshao closed this as completed Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants