# Thread: how do you put a repeating decimal into c++

1. ## how do you put a repeating decimal into c++

How do you put a repeating decimal into c++ code for example 10.7333333 repeating the 3 2. There are fundamental limits on how many useful digits a number like that will contain anyway. So you can write 10.73333 for your purposes. If you really care, you can do some math like 10.4 + 1.0 / 3.0 3. well i need to declare it in my code because the variable G = 32.2 ft/s^2 so i need to convert it to yds/s^2 and the number is 10.73 with the 3 repeating 4. Yeah, divide by 3, like every other feet to yard conversion. The math will be correct. 5. okay so im new to this will the require me to put #include <math.h>? 6. If you use functions from math.h, then yes you do. I don't know from the information that you gave me that you are actually using any math functions. You can divide without a library. 7. what do you mean by math functions? 8. The link in my previous post actually lists all of them. If you aren't using any, then no reason to include cmath exists. 9. okay thank you so much!!! Popular pages Recent additions 