Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 17th, 2024, 12:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How do I get random negative through to positive numbers
PostPosted: November 25th, 2004, 2:37 pm 
Offline

Joined: November 25th, 2004, 2:23 pm
Posts: 24
Location: Wiltshire, UK
Opus: 9.03
OS: Win7 x64
System: ACER i7 4GB RAM
Random positive numbers are easy, but how can I get a random value from say minus (-) 99 to plus (+) 99?


For this message Glen Burn has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 25th, 2004, 2:57 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

The easiest way to achieve this would be to generate a random number between 0 and 200, then simply subtract 100 from the result. This should give you random numbers within the range -100 to +100.

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Delightfully simple! Thanks
PostPosted: November 26th, 2004, 11:16 pm 
Offline

Joined: November 25th, 2004, 2:23 pm
Posts: 24
Location: Wiltshire, UK
Opus: 9.03
OS: Win7 x64
System: ACER i7 4GB RAM
:D


For this message Glen Burn has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group