Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: BETWEEN
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 61 of 151 Topic 3827 of 4285
Post > Topic >>

Re: BETWEEN

by Bruce McFarling <agila61@[EMAIL PROTECTED] > Mar 31, 2008 at 02:43 PM

The thing with signed complement is I didn't see how it could be
implemented with a common algorithm, since the wrap around is at the
same point and lands in a different place ... -MAX and 0.

But if in signed magnitude an unsigned number cannot specific a number
that is a signed negative, there's no problem ... just do the signed
WITHIN and its valid for unsigned.

On Mar 31, 5:21 pm, Jonah Thomas <jethom...@[EMAIL PROTECTED]
> wrote:
> 1's complement can be designed like sign magnitude to allow only
> unsigned numbers that leave the sign bit unset. Then there should be no
> trouble except with -0. But if you have high unsigned numbers you have a
> problem. In an illustrative 16-bit 1's-complement system, -0 = 65535 and
> -1 = 65534. So when you do an implicit conversion between negatve and
> high unsigned numbers, you get a different result from 2's-complement.
> If you get the same result for -2 2 WITHIN for both systems, then you'll
> have to get different results for 65533 2 WITHIN .

Huh?

-2 2 WITHIN should be TRUE (-0) for -2 -1 -0 0 1

True for -2 stepping by 1+, including wrap-around, until and not at 2.

65533 2 WITHIN should be TRUE (-0) for 65533 65534 65535 0 1

True for 65533 stepping by 1+, including wrap-around, until and not at
2.

Sure you get a different result from 2's complement if you write the
value in binary and then change the base to DECIMAL, but if you write
both the value to test and the range as one's complement numbers,
that's _pari passu_.

So after thinking that through, I'm thinking that the U< based WITHIN
works for one's complement signs, provided you are willing to accept
that 0's sort as:

-1 < -0 < 0 < 1

.... since in that approach, -0 -10 0 WITHIN would yield -0 or TRUE.
That seems reasonable to me, though, since ( value negative 0 ) WITHIN
to me feels like a test for a negative smaller or equal to a given
magnitude, and -0 would be your negative number smaller than any other
negative number.
 




 151 Posts in Topic:
BETWEEN
"Ed" <nospam  2008-03-11 10:05:05 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-10 23:27:36 
Re: BETWEEN
"Ed" <nospam  2008-03-12 10:59:55 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-12 02:02:50 
Re: BETWEEN
"Ed" <nospam  2008-03-14 12:44:03 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-14 19:55:40 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-11 23:38:22 
Re: BETWEEN
Elizabeth D Rather <er  2008-03-11 21:57:31 
Re: BETWEEN
"Ed" <nospam  2008-03-14 12:50:14 
Re: BETWEEN
Bruce McFarling <agila  2008-03-21 06:59:32 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-21 15:16:33 
Re: BETWEEN
Bruce McFarling <agila  2008-03-11 20:06:28 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-12 19:29:05 
Re: BETWEEN
William James <w_a_x_m  2008-03-12 02:28:18 
Re: BETWEEN
Bruce McFarling <agila  2008-03-12 11:56:09 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-12 20:21:19 
Re: BETWEEN
Bruce McFarling <agila  2008-03-12 12:43:41 
Re: BETWEEN
Bruce McFarling <agila  2008-03-13 18:59:54 
Re: BETWEEN
Bruce McFarling <agila  2008-03-13 19:07:20 
Re: BETWEEN
"Ed" <nospam  2008-03-14 14:50:16 
Re: BETWEEN
Bruce McFarling <agila  2008-03-14 06:45:40 
Re: BETWEEN
Bruce McFarling <agila  2008-03-14 07:32:38 
Re: BETWEEN
Bruce McFarling <agila  2008-03-14 07:38:48 
Re: BETWEEN
Bruce McFarling <agila  2008-03-14 13:57:04 
Re: BETWEEN
Bruce McFarling <agila  2008-03-16 13:27:20 
Re: BETWEEN
Bruce McFarling <agila  2008-03-18 08:51:45 
Re: BETWEEN
anton@[EMAIL PROTECTED]   2008-03-18 19:49:37 
Re: BETWEEN
Bruce McFarling <agila  2008-03-20 14:16:42 
Re: BETWEEN
Bruce McFarling <agila  2008-03-20 14:20:37 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-21 11:44:48 
Re: BETWEEN
Bruce McFarling <agila  2008-03-20 15:31:50 
Re: BETWEEN
William James <w_a_x_m  2008-03-12 02:41:44 
Re: BETWEEN
Bruce McFarling <agila  2008-03-12 08:47:12 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-12 12:14:00 
Re: BETWEEN
Bruce McFarling <agila  2008-03-12 11:14:39 
Re: BETWEEN
mhx@[EMAIL PROTECTED] (M  2008-03-12 19:29:03 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-12 14:57:02 
Re: BETWEEN
Brad Eckert <nospaambr  2008-03-14 08:23:24 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-14 09:33:12 
Re: BETWEEN
William James <w_a_x_m  2008-03-15 12:56:09 
Re: BETWEEN
"Ed" <nospam  2008-03-16 17:44:01 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-16 08:57:06 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-17 11:02:53 
Re: BETWEEN
Elizabeth D Rather <er  2008-03-17 10:31:11 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-16 08:08:44 
Re: BETWEEN
"Ed" <nospam  2008-03-20 11:38:02 
Re: BETWEEN
Bruce McFarling <agila  2008-03-15 13:43:21 
Re: BETWEEN
Bruce McFarling <agila  2008-03-15 17:09:04 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-16 04:15:04 
Re: BETWEEN
Bruce McFarling <agila  2008-03-15 21:11:00 
Re: BETWEEN
Josh Grams <josh@[EMAI  2008-03-16 13:09:01 
Re: BETWEEN
Bernd Paysan <bernd.pa  2008-03-16 14:21:15 
Re: BETWEEN
Bruce McFarling <agila  2008-03-16 13:34:47 
Re: BETWEEN
Bruce McFarling <agila  2008-03-16 13:41:06 
Re: BETWEEN
Brad Eckert <nospaambr  2008-03-20 07:55:09 
Re: BETWEEN
"Ed" <nospam  2008-03-29 12:50:55 
Re: BETWEEN
Bruce McFarling <agila  2008-03-31 10:32:03 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-31 13:40:23 
Re: BETWEEN
Bruce McFarling <agila  2008-03-31 11:09:41 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-31 16:17:43 
Re: BETWEEN
Bruce McFarling <agila  2008-03-31 14:43:42 
Re: BETWEEN
Bruce McFarling <agila  2008-03-31 15:46:09 
Re: BETWEEN
Robert Spykerman <robe  2008-03-31 20:38:09 
Re: BETWEEN
Robert Spykerman <robe  2008-03-31 21:17:44 
Re: BETWEEN
"Ed" <nospam  2008-04-02 00:00:00 
Re: BETWEEN
Bruce McFarling <agila  2008-04-04 08:15:18 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-12 07:53:19 
Re: BETWEEN
Albert van der Horst <  2008-03-12 18:13:20 
Re: BETWEEN
anton@[EMAIL PROTECTED]   2008-03-13 10:17:59 
Re: BETWEEN
"Ed" <nospam  2008-03-14 13:39:47 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-14 20:01:22 
Re: BETWEEN
mhx@[EMAIL PROTECTED] (M  2008-03-14 20:15:44 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-14 20:22:52 
Re: BETWEEN
"Ed" <nospam  2008-03-15 12:05:20 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-15 13:29:06 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-13 12:29:14 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-13 11:17:54 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-13 13:30:49 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-13 11:45:23 
Re: BETWEEN
David Thompson <dave.t  2008-03-31 04:27:44 
Re: BETWEEN
Bruce McFarling <agila  2008-03-12 10:58:12 
Re: BETWEEN
Bruce McFarling <agila  2008-03-12 12:35:02 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-12 14:54:19 
Re: BETWEEN
William James <w_a_x_m  2008-03-13 11:24:23 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-13 12:52:26 
Re: BETWEEN
William James <w_a_x_m  2008-03-13 12:17:12 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-13 13:33:20 
Re: BETWEEN
anton@[EMAIL PROTECTED]   2008-03-13 19:51:14 
Re: BETWEEN
William James <w_a_x_m  2008-03-13 14:48:22 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-13 18:04:08 
c-version, was Re: BETWEEN
Albert van der Horst <  2008-03-14 09:09:50 
Re: BETWEEN
anton@[EMAIL PROTECTED]   2008-03-14 11:37:38 
Re: BETWEEN
William James <w_a_x_m  2008-03-13 14:58:01 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-13 18:17:33 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-13 16:48:39 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-13 19:14:32 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-13 17:31:16 
Re: BETWEEN
Albert van der Horst <  2008-03-14 09:30:54 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-15 02:07:32 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-14 19:21:08 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-15 14:33:26 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-15 11:29:17 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-15 11:00:02 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-15 13:34:31 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-15 11:48:39 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-15 14:02:32 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-15 21:27:37 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-15 20:15:10 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-15 13:48:20 
Re: BETWEEN
Albert van der Horst <  2008-03-16 13:43:28 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-16 11:38:32 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-15 17:11:08 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-16 04:07:29 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-14 23:44:25 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-15 15:05:03 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-15 17:36:43 
Re: BETWEEN
Aleksej Saushev <asau@  2008-03-16 04:12:06 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-14 08:19:15 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-14 14:18:34 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-18 00:00:17 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-18 12:13:01 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-18 11:41:04 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-18 16:15:39 
Re: BETWEEN
"Ed" <nospam  2008-03-15 12:40:01 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-15 10:05:21 
Re: BETWEEN
"Ed" <nospam  2008-03-16 16:56:01 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-16 08:50:11 
Re: BETWEEN
"Ed" <nospam  2008-03-18 10:48:20 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-18 00:55:08 
Re: BETWEEN
"Ed" <nospam  2008-03-20 11:36:33 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-18 00:03:13 
Re: BETWEEN
Duke Normandin <dukeof  2008-03-17 23:28:44 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-18 00:52:09 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-18 12:11:31 
Re: BETWEEN
Duke Normandin <dukeof  2008-03-18 00:51:56 
Re: BETWEEN
John Doty <jpd@[EMAIL   2008-03-17 19:10:30 
Re: BETWEEN
Duke Normandin <dukeof  2008-03-18 05:40:19 
Re: BETWEEN
Coos Haak <chforth@[EM  2008-03-18 18:32:33 
Re: BETWEEN
Duke Normandin <dukeof  2008-03-19 02:09:21 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-14 10:33:48 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-14 10:40:29 
Re: BETWEEN
William James <w_a_x_m  2008-03-14 09:21:41 
Re: BETWEEN
Bruce McFarling <agila  2008-03-14 09:49:52 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-16 10:24:22 
Re: BETWEEN
Jerry Avins <jya@[EMAI  2008-03-16 11:35:57 
Re: BETWEEN
Andrew Haley <andrew29  2008-03-17 10:37:08 
Re: BETWEEN
Bruce McFarling <agila  2008-03-20 04:32:31 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-31 17:21:03 
Re: BETWEEN
"Ed" <nospam  2008-04-05 01:28:53 
Re: BETWEEN
Jonah Thomas <jethomas  2008-03-31 18:05:58 
Re: BETWEEN
Jonah Thomas <jethomas  2008-04-04 14:46:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 13:41:18 CDT 2008.