Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • R relibc
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 35
    • Issues 35
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container 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
  • redox-osredox-os
  • relibc
  • Merge requests
  • !231

Implement ecvt, fcvt, gcvt

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Peter Limkilde Svendsen requested to merge plimkilde/relibc:cvt into master Jul 10, 2019
  • Overview 7
  • Commits 12
  • Pipelines 3
  • Changes 7

Implement POSIX legacy functions ecvt, fcvt and gcvt, see http://pubs.opengroup.org/onlinepubs/7908799/xsh/ecvt.html. ecvt and fcvt are implemented basically by picking apart the output of Rust's format! macro. gcvt has a simple C implementation taken from musl.

There are quite a few corner cases here, thus the expected output file is pretty large. Turns out this was also a bit of a stress test for printf's floating point handling, which is why the value is not printed in each output line.

gcvt is not part of this MR. It should be trivial to implement in C, but I had some trouble getting it to build (probably just need to understand the cbindgen setup etc.).

Edit: got gcvt to "work", i.e. it is callable but the underlying %.*g formatting does not currently seem to be supported.

Edit 2: Rebased after 57917c0e fixed the %.*g issue, gcvt is now working. printf still does not like infinity, though.

Edited Jul 16, 2019 by Peter Limkilde Svendsen
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cvt