Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Fractions in C++? filter_list
Author
Message
Fractions in C++? #1
I was writing a primitive program involving solving a random equation, and I noticed that when I entered:

long double y;
y = (1/5) + (2/8);

cout << y

The computer could not read the fractions, and it only worked when I changed it to decimals. Is there any way to use fractions in C++, or is it limited to significant figures?

Reply





Messages In This Thread
Fractions in C++? - by Skipperdoo32 - 09-13-2011, 02:49 AM



Users browsing this thread: 1 Guest(s)