# Questions tagged as 'random'

1

## MySQL select random with priorities

I have the following scenario, I have a table and I need to make a select with an order by RAND (). But I'd like to put some conditions for example: TABELA ID | NOME | IDADE | GRUPO    Data 1 | Hiago | 20 | 1 2 | Igor | 15| 1 3 | Ana| 18...
2

## Generate float values between -1 and 1

I am trying to generate float values between -1 and 1 to test if they are within the defined limits in order to create a vector with the amount of data I want only that I am only able to generate% between 0 and 1 through the function f...
4

## Manipulating chances with JS when using Math.random ()?

When using this function Math.floor((Math.random() * 10) + 1) I get a random number from 1 to 10. We assume that each number has a 10% chance so we have a 50% Odd or Even chance, but what if I wanted to manipulate those chances, so that t...
2

## Generate random data within a range

I can not return any number. Ex: If you use "minor 1500" and "greater 5000", it was to appear in this range if you did not enter while , only it is not returning anything. public int aleatoriar(int maior, int menor) { int retorno...
2

## Error compiling code with import java.util.Random; random.nextInt ()

I'm studying the Java programming language and found an obstacle, by some chance I can not compile this code import java.util.Random; public class Random { public static void main(String[] args){ Random num = new Random();...
4

## Rand between numbers with comma

How to generate a number float between two numbers? Eg: A random number between -270.33 and -47.5.
1

## When I create a function in C ++ do the variables inside it stay in memory?

When I studied pseudocode, I learned that when you call a function and create a variable, it only "exists" when I call that function, for example. funcao teste(): x = 10 retorna x In case, when I called my test function, it woul...
2

## Maximum value for srand ((unsigned) time (NULL));

I was reading about random numbers not being so random and I saw one way out was to feed a seed with srand((unsigned)time(NULL) ); To test I generated a vector of 100,000 positions and ordered it, but it only has the number 32767...
2