This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/modf.c

13 lines
324 B
C

#include <stdio.h>
#include <math.h>
void main()
{
double integral_value, fractional_part;
fractional_part = modf( 4.5, &integral_value );
printf( "%f %f\n", fractional_part, integral_value );
fractional_part = modf( -4.5, &integral_value );
printf( "%f %f\n", fractional_part, integral_value );
}