Bug 64062 - $RANDOM alternates between even and odd numbers
$RANDOM alternates between even and odd numbers
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: wdovlrrw
Ben Levenson
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-24 16:35 EDT by Philipp Rumpf
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-24 16:35:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Philipp Rumpf 2002-04-24 16:35:43 EDT
Description of Problem:
$RANDOM alternates between even and odd numbers.


Version-Release number of selected component (if applicable):
bash 2.05.8(1)-release


How Reproducible:
reproducible

Steps to Reproduce:
1. bash -c 'echo $((($RANDOM+$RANDOM) % 2))'


Actual Results:
1


Expected Results:
0 or 1 at 50 per cent probability each
Comment 1 Phil Knirsch 2002-07-23 04:31:38 EDT
Fixed in current version of bash available via rawhide.

(Or at least can't reproduce the described behaviour with the current version
anymore).

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.