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 <math.h>
#include <stdbool.h> #include <stdbool.h>
#include <limits.h> #include <limits.h>
#include <float.h>
#define LD(name)\ #define LD(name)\
long double name##ldvalue;\ long double name##ldvalue;\
@ -208,4 +209,12 @@ unsigned long long getull(char *message, unsigned long long *min, unsigned long
LD(min) LD(min)
LD(max) LD(max)
return getNumber(message, minld, maxld, NULL, NULL, 0, ULLONG_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