Sha256: 38d7e3b6c515b881078ebd21ca8063d2ca105cd319695d29538f879e37f091b5
Contents?: true
Size: 362 Bytes
Versions: 31
Compression:
Stored size: 362 Bytes
Contents
#![cfg(feature = "arbitrary_precision")] #[test] fn test() { let float = 5.55f32; let value = serde_json::to_value(float).unwrap(); let json = serde_json::to_string(&value).unwrap(); // If the f32 were cast to f64 by Value before serialization, then this // would incorrectly serialize as 5.550000190734863. assert_eq!(json, "5.55"); }
Version data entries
31 entries across 31 versions & 1 rubygems