C/C++: Découper un valeur en virgule flottante en parties fractionnaire et entière

Author:


{filelink=14009}


#include 
#include


int main ()
{
  double val, part_frac, part_entier;

  val = 3.14;

  part_frac = modf (val , &part_entier);

  printf ("%lf = %lf + %lf ", val, part_entier, part_frac);

  return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *