rust-cli / rust-cli/config-rs

Floating point vs real integers

Open
#182 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

E-help-wanted
Dominant language
Rust
Stars
3.2k
Forks
265
Avg merge
2h 42m
Merged PRs (30d)
4

Description

As of master, this crate interprets i64 as f64 in the Value::into_float() method.

This has edge-cases where i64 can have a value that cannot be represented in f64.
Thus, we should change the code to not interpret i64s as f64, IMO.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Value::into_float() method and trace how integer values are converted and used. Reproduce the edge case with an i64 value that cannot be represented exactly as f64, then inspect the surrounding tests and behavior to define a safe regression case. Done means the precision-loss behavior is addressed without breaking supported configuration values.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.