Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double/Floats near integer values are not printed correctly in certain situations #1

Open
JMarple opened this issue Feb 7, 2018 · 0 comments
Labels
bug Something isn't working p: high High priority
Milestone

Comments

@JMarple
Copy link

JMarple commented Feb 7, 2018

void initialize() {
  for (float x = 0.96; x < 1.04; x+=0.01)
  {
    printf("%f\n", x);
  }
}

Expected Behavior:

0.960000
0.970000
0.980000
0.990000
1.000000
1.010000
1.020000
1.030000

Actual Behavior:

0.960000
0.970000
0.980000
0.990000
0.000000
1.010000
1.020000
1.030000

Steps to reproduce:

Run code above in new project.

System information:

Kernel Version: V2.12.1

@HotelCalifornia HotelCalifornia transferred this issue from purduesigbots/pros Jan 31, 2019
@HotelCalifornia HotelCalifornia added this to the 2.13.0 milestone Jan 31, 2019
@HotelCalifornia HotelCalifornia added bug Something isn't working p: high High priority labels Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p: high High priority
Projects
None yet
Development

No branches or pull requests

2 participants