Bug 64062 - $RANDOM alternates between even and odd numbers
Summary: $RANDOM alternates between even and odd numbers
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: wdovlrrw
QA Contact: Ben Levenson
URL:
Whiteboard:
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:
Clone Of:
Environment:
Last Closed: 2002-04-24 20:35:47 UTC
Embargoed:


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.