Comments (9)
This is not the case with integers.
from cjsonobject.
In my operating system (win10), when I execute the EXE I generate, as long as the integer is incremented by a small enough number, it can be parsed by cjson。
from cjsonobject.
I suspect this is a matter of the compiler handling floating-point precision
from cjsonobject.
The compiler I use is mingw32 7.4.0。
from cjsonobject.
from cjsonobject.
Waiting for your good news。祝你旅途愉快!
from cjsonobject.
另外,这个cjsonobject 怎么识别null和true、false,这也是经常要用到的。好像没有这样的实例函数,只有一个IsEmpty()?
from cjsonobject.
问题不在.Get(0,fvalue),在cJSON.c里的print_double(),在你的例子中做了json赋值,赋值时ToString()方法会调用print_double(),而print_double()将.0截掉了,值变成了整数。
另外,你提到的null,我也加入了对null的支持,不过建议能不用null就尽量别用null,null虽然是json属于json标准,但用在C++这种强类型语言里不是太合适,明确一个json value是string、int、float或{}又或[]会更好。
from cjsonobject.
非常感谢,试过了,已经比较完善了,感谢你的辛劳和付出。
from cjsonobject.
Related Issues (20)
- 这个库和MemJson比怎么样? HOT 1
- parse 64bit integer failed on windows HOT 1
- 部分中文字符Parse()之前是好的,Parse()完之后就乱码了 HOT 3
- 直接运行demo出现段错误 (核心已转储) HOT 1
- CJsonObject::operator[] vs2019 c++14 release have exception HOT 1
- 含有某些字导致Parse出现错误 HOT 2
- CJsonObject.cpp的372行判断宏是否有问题? HOT 1
- parse_number函数解析double型value时结果不正确 HOT 2
- android 编译64位报错 HOT 1
- 这个库支持json和类、结构体的转换嘛 HOT 1
- 无法解析的外部符号 HOT 1
- IsEmpty方法感觉语义不清 HOT 3
- 一个下标问题! HOT 2
- json字符串中包含一个value为json格式的字符串用默认构造函数转换失败 HOT 4
- CJSON版本
- 遍历 HOT 1
- 请问这个库是如何实现内存管理的
- 有关CJsonObject []和=重载符的疑问 HOT 1
- 请问能否添加对于内存管理的钩子,就像cJSON那样? HOT 1
- 布尔类型被转化为整数 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cjsonobject.