+ 1
How to check if the number is a repeating decimal?
As said in the question, I need something that can give me a boolean value that is either true or false according to the number. For example 7,7777... or 4,123123123... would return true. And 5,5 would return false.
10 ответов
+ 2
Convert decimal to string and then you can see if next or previous number is same then number is repeate.
0
if you know the two numbers that generate the fraction you can find out if it is repetative or not. this is probably even better than converting to String ..
0
But 4,5425 is not something repeating
0
Or what if the number is 4,542542... ? Previous or next number is not repeated yogesh lodha Anton Böhler
0
Logic will be previous and next number.
But you need to check 2 number group and then 3 number group
0
yogesh lodha What if the number is repeating 4 digits? I need something that checks if the number is repeating and goes forever or not
0
You need to check number list
N/2
If 24466975 there is 4 number group need to check
0
I didn't get ya. Can you write the code that is able to do what I asked?
0
Tysm