floating point - How to get the opposite side of round()/floor() in C? -


i have double a=1234.5678, can 1234 floor(a), how 0.5678? know can subtract a-floor(a), there function in runtime library?

modf break double value in 2 parts

double param, fractpart, intpart;  param = 3.14159265; fractpart = modf (param , &intpart); printf ("%f = %f + %f \n", param, intpart, fractpart); return 0; 

output: 3.141593 = 3.000000 + 0.141593

you have include math.h

http://www.cplusplus.com/reference/cmath/modf/


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -