[Talossa.com portal]
[Citizens Toolbox]
[Immigration]
No Running elections

Parent message
Mr. Furxheir, R.M.W.February 17, 2005 - 09:52
RE: This one might do better(#1107), posted by D. N. Vercáriâ, [IP Hidden], February 17, 2005 - 10:29. Viewed 666 times.
User InfoText
D. N. Vercáriâ
Group: citizens
(4498 posts total)
(last post: March 15, 2008 - 16:51)
Citizen #26:
Dieter N Vercáriâ
>
> > if ((elapsed_days <= X) || ((quorum_reached == 1) && (24_hours_passed == 0)))
> > continue_voting ();
> > else
> > announce_results();

> >
>
>
> Actually, it would be :
>
> if ((elapsed_days <= X) && (quorum_reached == 1) && (24_hours_passed_since_quorum == 0))
> continue_voting ();
> else
> announce_results();

>
>
> You need BOTH the elasped days AND the Quorum.

Yes, but you certainly meant to say:

if ((elapsed_days <= X) && ((quorum_reached == 0)||((quorum_reached == 1) && (24_hours_passed_since_quorum == 0))))
continue_voting ();
else
announce_results();


because in your algorithm quorum_reached == 0 would mean that the result of the whole boolean expression is 0 ("FALSE"), thus announce_results() would have to be performed. ;-)

- D. N. Vercáriâ
RE: This one might do betterD. N. VercáriâFebruary 17, 2005 - 10:29
Mr. Furxheir, R.M.W.February 17, 2005 - 10:48
Justice dal NavâFebruary 17, 2005 - 17:58
D. N. VercáriâFebruary 18, 2005 - 03:31
Justice dal NavâFebruary 18, 2005 - 07:20
D. N. VercáriâFebruary 17, 2005 - 12:08
Back to the forum | Forums Overview| Activate Thread View
Forums Overview | Login | Register | Lost your password? Cyphor (Release: 0.19, PHP 5.2.5)