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: Maybe a new...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 17 Topic 3795 of 4224
Post > Topic >>

Re: Maybe a newbie question..

by sbi82 <stefanobiz@[EMAIL PROTECTED] > Mar 3, 2008 at 08:43 PM

Scriveva Jonah Thomas lunedė, 03/03/2008:
> I ask you to think about that a little more.
>
> You have two outcomes, execute WORD1 or extecute WORD2.
>
> You have a bug that you don't know about, where the test that's supposed
> to tell you whether to use WORD1 or WORD2 gives you a wrong answer or
> the test is bypassed and you're getting a random value as the test
> result. Your response is to force the use of WORD1 if the wrong test
> result is a negative number, and force the use of WORD2 if the result is
> a positive number that's out of range, and do nothing to tell you
> there's any error. 
>
> That might be a good approach in the short run, sometimes. Maybe you're
> collecting a thousand samples a second to do statistics on and one time
> out of 100,000 you do the wrong thing, and it doesn't really matter. The
> result is that 0.001% of your data is wrong, and the problem will likely
> be lost in the noise. Your users won't notice, you won't notice,
> everybody's happy. It isn't good but frankly your users will be happier
> than they would if you told them there was a problem they had to deal
> with. On the other hand, if one time in 100,000 your program fires an
> armed missile when it shouldn't....
>
> Wouldn't you like to find out about the problem and choose what to do
> about it? Sometimes that's im****tant. Far better to fix the problem than
> just choose WORD2 and forget it.

>
> here's a more complicated way to do it:
>
> T-JUMP ( *ix base-address item -- *jx)
>    1+ 0 MAX 3 MIN CELLS + @[EMAIL PROTECTED]
 EXECUTE ;
>
> CREATE SEL_WORD ' BOUNDS-UNDERFLOW , ' WORD1 , ' WORD2 , '
> BOUNDS-OVERFLOW ,
>
>  .... SEL_WORD TEST T-JUMP
>
> So if you have a bounds error you execute either BOUNDS-UNDERFLOW or
> BOUNDS-OVERFLOW which presumably will *tell* you about it. If you want
> you can have it tell you about the problem and then execute WORD1 or
> WORD2  so the system doesn't stop functioning. Or discard the data and
> wait for the next signal. Or whatever you think ahead of time is best
> after the undiscovered error. But if the error is there you probably
> want to find out about it, right?

What to say...
Thanks again!
It's very nice the hint 1+ 0 MAX 3 MIN CELLS + @[EMAIL PROTECTED]
 in order to 
find the error and execute BOUNDS-OVERFLOW ;-)

-- 
Su msn: sbi82 chiocciola hotmail punto it
Non c'č cattivo pių cattivo di quando un buono diventa cattivo! (Bud 
Spencer)
Ciao da Stefano
 




 17 Posts in Topic:
Maybe a newbie question..
sbi82@[EMAIL PROTECTED]   2008-03-03 01:07:27 
Re: Maybe a newbie question..
Jonah Thomas <jethomas  2008-03-03 06:08:41 
Re: Maybe a newbie question..
sbi82 <stefanobiz@[EMA  2008-03-03 13:09:18 
Re: Maybe a newbie question..
Jonah Thomas <jethomas  2008-03-03 06:20:49 
Re: Maybe a newbie question..
Jonah Thomas <jethomas  2008-03-03 07:53:00 
Re: Maybe a newbie question..
sbi82 <stefanobiz@[EMA  2008-03-03 19:29:49 
Re: Maybe a newbie question..
Brad Eckert <nospaambr  2008-03-03 08:34:37 
Re: Maybe a newbie question..
sbi82 <stefanobiz@[EMA  2008-03-03 19:27:07 
Re: Maybe a newbie question..
Elizabeth D Rather <er  2008-03-03 09:07:37 
Re: Maybe a newbie question..
sbi82 <stefanobiz@[EMA  2008-03-03 20:39:28 
Re: Maybe a newbie question..
Elizabeth D Rather <er  2008-03-03 10:20:50 
Re: Maybe a newbie question..
Jonah Thomas <jethomas  2008-03-03 14:38:38 
Re: Maybe a newbie question..
sbi82 <stefanobiz@[EMA  2008-03-03 20:43:49 
Re: Maybe a newbie question..
stephenXXX@[EMAIL PROTECT  2008-03-03 15:48:41 
Re: Maybe a newbie question..
Bruce McFarling <agila  2008-03-03 15:54:59 
Re: Maybe a newbie question..
m_l_g3@[EMAIL PROTECTED]   2008-03-05 11:25:00 
Re: Maybe a newbie question..
Elizabeth D Rather <er  2008-03-24 10:57: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 Sat Aug 30 8:27:56 CDT 2008.