Skip to content
Snippets Groups Projects
Commit 528d6887 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Zahlen quadrieren, wissenschaftliche Notation von Fließkommazahlen, 28.11.2022

parent 0ed6745c
Branches
Tags
No related merge requests found
#include <stdio.h>
#include <math.h>
int main (void)
{
double x = 3.0;
printf ("x^2 = %lf\n", pow (x, 2.0));
return 0;
}
#include <stdio.h>
#include <math.h>
int main (void)
{
double x = 3.0;
printf ("sin x = %lf\n", sin (x));
return 0;
}
#include <stdio.h>
#include <math.h>
int main (void)
{
double x = 3.0;
printf ("x^3.5 = %lf\n", pow (x, 3.5));
return 0;
}
#include <stdio.h>
#include <math.h>
int main (void)
{
double x = 9.0;
printf ("x^0.5 = %lf\n", pow (x, 0.5));
return 0;
}
#include <stdio.h>
#include <math.h>
double my_pow (double x, double a)
{
return exp (a * log (x));
}
int main (void)
{
double x = 9.0;
printf ("x^0.5 = %lf\n", my_pow (x, 0.5));
return 0;
}
#include <stdio.h>
#include <math.h>
int main (void)
{
double x = 3.0;
printf ("x^2 = %lf\n", x * x);
return 0;
}
#include <stdio.h>
#include <math.h>
double sqr (double x )
{
return x * x;
}
int main (void)
{
double x = 3.0;
printf ("x^2 = %lf\n", sqr (x));
return 0;
}
#include <stdio.h>
#include <math.h>
#define G (6.67 * pow (10.0, -11.0))
int main (void)
{
printf ("G = %lf\n", G);
return 0;
}
#include <stdio.h>
#include <math.h>
#define G (6.67 * pow (10.0, -11.0))
int main (void)
{
printf ("G = %lg\n", G);
return 0;
}
#include <stdio.h>
#include <math.h>
#define G 6.67e-11
int main (void)
{
printf ("G = %lg\n", G);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment