We have a rational number double. How do you know whether it's periodic or not?  Continuous (coupling) fragments

We're given. sound Number
double
♪ How do you know whether it's periodic or not?

"Inside."
double
kept in the computation system for reasons2
and because10 = 2 * 5
any number presented by the final binary fragment may also be at the end of the decimal place.Accordingly, starting at some point, the endless decimal recording of any number submitted by the type
double
will be composed exclusively of zeros, which fits the definition of infinite sequence with period 1. Therefore:bool is_periodic(double x) { return true; }
But there's a nuance.: This does not include infinity and NaN. Since they are not substance numbers, I have not considered these cases.