Map#setBearing handles some floats and integers incorrectly
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 0.52.0
**browser**: Chrome 71.0.3578.98 (Official Build) (64-bit)
### Steps to Trigger Behavior
1. Make sure the map's bearing is set to an integer value
2. Set the bearing to a small float value
3. Read the bearing ‒ it's not the right value
### Link to Demonstration
https://jsbin.com/harefagilu/edit?html,console
### Expected Behavior
Bearing should equal `0.1`.
### Actual Behavior
Bearing equals `0.10000000000002274`.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Map#setBearing implementation and reproduce the behavior using the linked JSBin demonstration in Chrome. Verify the bearing transition from an integer to 0.1 and confirm that the reported value equals 0.1 when the issue is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100