X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Floop.c;h=e9bb674749bf9626f2dfcf0b2f3719b5e2f6a3ef;hb=b70dc1a6b7b15967ceb111f80dff65c44f0fac57;hp=5d9266b0e49c24d45df07e2d74a54c2b1c187c14;hpb=7b98b3a4f58f6dc5a8e9cbc188b627966d5e652d;p=pspp diff --git a/src/loop.c b/src/loop.c index 5d9266b0e4..e9bb674749 100644 --- a/src/loop.c +++ b/src/loop.c @@ -20,12 +20,12 @@ #include #include #include "alloc.h" -#include "approx.h" #include "command.h" #include "do-ifP.h" #include "error.h" #include "expr.h" #include "lexer.h" +#include "misc.h" #include "settings.h" #include "str.h" #include "var.h" @@ -254,12 +254,7 @@ internal_cmd_loop (void) { two->index = dict_lookup_var (default_dict, name); if (!two->index) - { - two->index = dict_create_var (default_dict, name, 0); -#if DEBUGGING - envector (two->index); -#endif - } + two->index = dict_create_var (default_dict, name, 0); } /* Push on control stack. */ @@ -376,8 +371,7 @@ loop_1_trns_proc (struct trns_header * trns, struct ccase * c) c->data[two->index->fv].f = t1.f; /* Throw out various pathological cases. */ - if (!finite (t1.f) || !finite (t2.f) || !finite (t3.f) - || approx_eq (t2.f, 0.0)) + if (!finite (t1.f) || !finite (t2.f) || !finite (t3.f) || t2.f == 0.0) return two->loop_term; debug_printf (("LOOP %s=%g TO %g BY %g.\n", two->index->name, t1.f, t3.f, t2.f)); @@ -387,7 +381,7 @@ loop_1_trns_proc (struct trns_header * trns, struct ccase * c) two->flags &= ~LPC_RINDEX; /* incr>0 but init>term */ - if (approx_gt (t1.f, t3.f)) + if (t1.f > t3.f) return two->loop_term; } else @@ -396,7 +390,7 @@ loop_1_trns_proc (struct trns_header * trns, struct ccase * c) two->flags |= LPC_RINDEX; /* incr<0 but initloop_term; } @@ -437,7 +431,7 @@ loop_2_trns_proc (struct trns_header * trns, struct ccase * c) if (two->flags & LPC_RINDEX) { /* Test if we're at the end of the looping. */ - if (approx_lt (two->curr, two->term)) + if (two->curr < two->term) return two->loop_term; /* Set the current value into the case. */ @@ -450,7 +444,7 @@ loop_2_trns_proc (struct trns_header * trns, struct ccase * c) else if (two->flags & LPC_INDEX) { /* Test if we're at the end of the looping. */ - if (approx_gt (two->curr, two->term)) + if (two->curr > two->term) return two->loop_term; /* Set the current value into the case. */