Browse Source

implemented getlf

remotes/origin/userinput
TheUltimateOptimist 11 months ago
parent
commit
e2fb2c4835
  1. 9
      src/userinput.c

9
src/userinput.c

@ -7,6 +7,7 @@
#include <math.h>
#include <stdbool.h>
#include <limits.h>
#include <float.h>
#define LD(name)\
long double name##ldvalue;\
@ -209,3 +210,11 @@ unsigned long long getull(char *message, unsigned long long *min, unsigned long
LD(max)
return getNumber(message, minld, maxld, NULL, NULL, 0, ULLONG_MAX);
}
double getlf(char *message, double *min, double *max, double *greaterThan, double *smallerThan) {
LD(min)
LD(max)
LD(greaterThan)
LD(smallerThan)
return getNumber(message, minld, maxld, greaterThanld, smallerThanld, -DBL_MAX, DBL_MAX);
}
Loading…
Cancel
Save