Skip to content

Add double and float support to scan functionality#4473

Closed
way4sahil wants to merge 4 commits intofmtlib:masterfrom
way4sahil:add-double-float-scan-support
Closed

Add double and float support to scan functionality#4473
way4sahil wants to merge 4 commits intofmtlib:masterfrom
way4sahil:add-double-float-scan-support

Conversation

@way4sahil
Copy link
Copy Markdown

  • Add double_type and float_type to scan_type enum
  • Add double* and float* pointers to scan_arg union
  • Add constructors for double and float scan arguments
  • Add switch cases for double and float types in visit()
  • Implement read() functions for floating-point parsing

This resolves the TODO comment 'more types' in scan.h by adding support for the two most commonly needed floating-point types.

Verified: All tests pass (21/21 tests passed, 0 failed).

- Add double_type and float_type to scan_type enum
- Add double* and float* pointers to scan_arg union
- Add constructors for double and float scan arguments
- Add switch cases for double and float types in visit()
- Implement read() functions for floating-point parsing

This resolves the TODO comment 'more types' in scan.h by adding
support for the two most commonly needed floating-point types.

Verified: All tests pass (21/21 tests passed, 0 failed).
Copy link
Copy Markdown
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. This is mostly a proof of concept largely superseded by scnlib but we can merge it in. Please fix formatting per inline comment.

Copy link
Copy Markdown
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting (indent) is still wrong.

@vitaut
Copy link
Copy Markdown
Contributor

vitaut commented Jun 21, 2025

Merged with minor tweaks in a5dccff.

@vitaut vitaut closed this Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants