/media/sda-magnetic/david/Dokumente-16-2024-08-01/informatikUmathematik/excerpt20240906before/progs2sources20240801/ieee754aufgabe2.c


#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main (void) {
    time_t t;
    int n;
    float f1 = 1;
    float f2;
    float f3 = 100;
    float f4 = 0;


    srand ((unsigned )time (&t));

    f2 = (float) (rand () % (8192 * 4));

    n = (rand () % 8) + 2;

    while (n > 0) {
        f1 = f1 / 2;
        f3 = f3 / 10;
        f4 = f4 + (f3 * (rand () % 10));
        n--;
    }

    f2 = f2 + f1 + f4;

    printf ("Rechne die Zahl in IEEE-754 um %f\n", f2);


return 0;
}