"Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes:
>> } while (z <= 0 || z >= MAX_RANDOM_VALUE);
> Ah, yes ! That also works and is a lot nicer. Can you please apply ?
Done.
regards, tom lane
---(end of broadcast)---
T
> > Would we be happy with the following, which would work ?
> > } while (z <= 0 || z == MAX_RANDOM_VALUE);
>
> I suppose this doesn't?
> } while (z <= 0 || z >= MAX_RANDOM_VALUE);
Ah, yes ! That also works and is a lot nicer. Can you please apply ?
Together with the patch in
"Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes:
> Would we be happy with the following, which would work ?
> } while (z <= 0 || z == MAX_RANDOM_VALUE);
I suppose this doesn't?
} while (z <= 0 || z >= MAX_RANDOM_VALUE);
regards, tom lane
-
> ! } while (!(z > 0 && z < MAX_RANDOM_VALUE));
>
> ! } while (z == 0 || z == MAX_RANDOM_VALUE);
>
> This seems fairly ugly, since it eliminates the original coding's
> positive guarantee that the final result is in 0 < x < 1. Does your
yes, ugly :-(
> compiler manage not to choke if
Tom Lane wrote:
"Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes:
! } while (!(z > 0 && z < MAX_RANDOM_VALUE));
! } while (z == 0 || z == MAX_RANDOM_VALUE);
This seems fairly ugly, since it eliminates the original coding's
positive guarantee that the final result is in 0 < x < 1. Does
"Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes:
! } while (!(z > 0 && z < MAX_RANDOM_VALUE));
! } while (z == 0 || z == MAX_RANDOM_VALUE);
This seems fairly ugly, since it eliminates the original coding's
positive guarantee that the final result is in 0 < x < 1. Does your
co
Hi Peter,
While fighting with a compiler bug here, I came across the following code,
that loops here (on AIX 4.3.2) due to a compiler bug,
presumably with the z < MAX_RANDOM_VALUE (it even warns at compile time):
static double
random_fract(void)
{
longz;
/* random()