add pic_valid_int predicate
This commit is contained in:
parent
b95184431f
commit
fe56195988
|
@ -33,6 +33,7 @@ extern "C" {
|
|||
#include <setjmp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "xvect/xvect.h"
|
||||
|
|
|
@ -156,6 +156,8 @@ typedef struct pic_blob pic_blob;
|
|||
static inline enum pic_tt pic_type(pic_value);
|
||||
static inline const char *pic_type_repr(enum pic_tt);
|
||||
|
||||
static inline bool pic_valid_int(double);
|
||||
|
||||
static inline pic_value pic_nil_value();
|
||||
static inline pic_value pic_true_value();
|
||||
static inline pic_value pic_false_value();
|
||||
|
@ -256,6 +258,12 @@ pic_type_repr(enum pic_tt tt)
|
|||
return 0; /* logic flaw */
|
||||
}
|
||||
|
||||
static inline bool
|
||||
pic_valid_int(double v)
|
||||
{
|
||||
return INT_MIN <= v && v <= INT_MAX;
|
||||
}
|
||||
|
||||
static inline pic_value
|
||||
pic_nil_value()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue