Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (anonymous):

C++. How do I check if there is a ' . ' in my data type long? for example: rational (0.9), I want to know if it's a decimal so I can convert it to a fraction.

OpenStudy (anonymous):

A long variable cannot contain a fractional part, it is a long integer, which can only contain whole numbers. If you mean a float or double, you could use the modf function (see: http://www.cplusplus.com/reference/cmath/modf/ ) to split the number into an integer and fractional part.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!