Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #506
Closed
Open
Issue created May 18, 2017 by Administrator@rootContributor

Strange float serialization

Created by: anisimovsergey

I looked at FAQ and Pitfalls and couldn't find the answer. Please take a look at the following tests, I find it rather strange that OneFloatDefaultDigits3 passes successfully, does it exhibit expected behavior?

  SECTION("OneFloatDefaultDigits2") {
    array.add(0.01f);
    check(array, "[0.01]");
  }

  SECTION("OneFloatDefaultDigits3") {
    array.add(0.001f);
    check(array, "[0.00]");
  }

  SECTION("OneFloatDefaultDigits4") {
    array.add(0.0001f);
    check(array, "[10.00e-5]");
  }

I'm using Microsoft Visual Studio Enterprise 2015 Version 14.0.25123.00 Update 2

Assignee
Assign to
Time tracking