Does anyone know of a easy way to separate or display numbers to the left of the decimal point
like separate: 10.5
into 10 and 5?
Does anyone know of a easy way to separate or display numbers to the left of the decimal point
like separate: 10.5
into 10 and 5?
Uhm. Well, I think that
x = 10.5;
a = (int) x; /* = 10 */
y = (int)(x * 10.0); /* = 105 */
z = y - 10 * a; /* = 5 */
The modf function in math.h does just that
I realize this is a dumb comment, but does anyone else think that the % in the subject line looks like a 96?
Yeah, I see it now.
Awesome, thanks! Thats EXACTLY what I was looking for, I can't believe I didn't browse the function appendix!Originally posted by Salem
The modf function in math.h does just that
Yeah % does look like 96 if you stare at it. I've never noticed that before.