Login Page - Create Account

Support Board


Date/Time: Mon, 15 Sep 2025 15:01:16 +0000



Post From: Integer portion of a float

[2016-09-25 21:22:24]
User147461 - Posts: 33
Found both of these to work for what I need:

double x = 31415.9265, fracportion, intportion;
fracportion = modf(x, &intportion);

OR


int intportion = 31415.9265;

both returned the integer portion:
intportion = 31415