X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Ffloat-format.c;h=50a4eae6005b071e1d61320621aa424614fd2654;hb=c3bd77adba5746aae895e6a354aada4e694c0e3f;hp=79ba94469fc9fa085f2318d5f48d596f9c6b752f;hpb=0730ccfa7528b67b7b2d699925668ea3a6e77b75;p=pspp-builds.git diff --git a/src/libpspp/float-format.c b/src/libpspp/float-format.c index 79ba9446..50a4eae6 100644 --- a/src/libpspp/float-format.c +++ b/src/libpspp/float-format.c @@ -187,6 +187,24 @@ float_identify (double expected_value, const void *number, size_t length, } return match_cnt; } + +/* Returns the double value that is just greater than -DBL_MAX, + which in PSPP syntax files is called LOWEST and used as the + low end of numeric ranges that are supposed to be unbounded on + the low end, as in the missing value set created by, + e.g. MISSING VALUES X(LOWEST THRU 5). (-DBL_MAX is used for + SYSMIS so it is not available for LOWEST.) */ +double +float_get_lowest (void) +{ + struct fp fp; + double x; + + fp.class = LOWEST; + fp.sign = POSITIVE; + assemble_number (FLOAT_NATIVE_DOUBLE, &fp, &x); + return x; +} /* Returns CNT bits in X starting from the given bit OFS. */ static inline uint64_t