07-26-2024, 10:57 PM
(This post was last modified: 07-26-2024, 10:58 PM by Kernelpanic.)
@DSMan195276 - one should be able to integrate C/C++ functions using Declare . . . Can't one integrate the floor() function to determine an integer? Is that possible?
I don't have the nerve to try this out anymore. But it should work . . .
The example in C:
I don't have the nerve to try this out anymore. But it should work . . .
The example in C:
Code: (Select All)
//Ganzzahlwert einer eingegebenen Zahl ermitteln - 27. Juli 2024
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (void)
{
float wert1, wert2, wert3, wert4;
printf("\nDen Ganzzahlwert einer eingegebenen Zahl ermitteln");
printf("\n==================================================");
printf("\n\nGegebene Werte: 1.6 - 1.2 - 2.8 - 2.3\n\n");
wert1 = 1.6;
wert2 = 1.2;
wert3 = 2.8;
wert4 = 2.3;
printf("Wert-1 = %.1f\n", floor(wert1));
printf("Wert-2 = %.1f\n", floor(wert2));
printf("Wert-3 = %.1f\n", floor(wert3));
printf("Wert-4 = %.1f\n", floor(wert4));
return(0);
}