Generate random numbers between two numbers in ocean script

Status
Not open for further replies.

sitak

Newbie level 3
Joined
Dec 19, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
Hi,

I would like to generate random numbers between two decimal numbers in Ocean Script
eg: 2.5 to 3.5 i need to use this to vary lengths and widths of transistors from ocean script.(RAND_MAX is not known like in C)
Please help me doing this


Thanks,
Sita
 

most random number generators either give a result between 0-1 or give a result that is based on some limit, i.e. random(10) would give a result that is in the range 0-9.

If you want 2 significant digits then you can do something like 2.5+random(11)/10 (i.e. 2.5-3.5 inclusive).

Though I'm not sure if Ocean script allows for math to be performed. I did find that random(x_number) is the function used to generate random numbers.
 
Reactions: sitak

    sitak

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…