Bug 64062 - $RANDOM alternates between even and odd numbers
Summary: $RANDOM alternates between even and odd numbers
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
(Show other bugs)
Version: 7.2
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: wdovlrrw
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords: Security
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-04-24 20:35 UTC by Philipp Rumpf
Modified: 2007-04-18 16:42 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Philipp Rumpf 2002-04-24 20:35:43 UTC
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 08:31:38 UTC
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.