aboutsummaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 908ce8d..9b6b33c 100644
--- a/eval.c
+++ b/eval.c
@@ -162,11 +162,11 @@ eval(struct expr *expr, enum evalkind kind)
expr->u.constant.f = l->u.constant.u;
} else if (l->type->prop & PROPFLOAT && t->prop & PROPINT) {
if (t->u.basic.issigned) {
- if (l->u.constant.f < -1 - 0x7fffffffffffffff || l->u.constant.f > 0x7fffffffffffffff)
+ if (l->u.constant.f < -0x1p63 || l->u.constant.f >= 0x1p63)
error(&tok.loc, "integer part of floating-point constant %g cannot be represented as signed integer", l->u.constant.f);
expr->u.constant.i = l->u.constant.f;
} else {
- if (l->u.constant.f < 0 || l->u.constant.f > 0xffffffffffffffff)
+ if (l->u.constant.f < 0.0 || l->u.constant.f >= 0x1p64)
error(&tok.loc, "integer part of floating-point constant %g cannot be represented as unsigned integer", l->u.constant.f);
expr->u.constant.u = l->u.constant.f;
}