Skip to main content
Tweeted twitter.com/StackArduino/status/818285573957881856
added 1 character in body
Source Link
jfpoilpret
  • 9.2k
  • 7
  • 38
  • 54

In which file can I find the calculation that is called with random()? If it is not totoo much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}

In which file can I find the calculation that is called with random()? If it is not to much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}

In which file can I find the calculation that is called with random()? If it is not too much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}

Formula / calcualtioncalculation of the function random() / randomSeed()

In which file can I find the calculation that is called with random()? If it is not to much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}
void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}

Formula / calcualtion of the function random() / randomSeed()

In which file can I find the calculation that is called with random()? If it is not to much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}

Formula / calculation of the function random() / randomSeed()

In which file can I find the calculation that is called with random()? If it is not to much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}
Fixed typos.
Source Link
Ricardo
  • 3.4k
  • 2
  • 26
  • 55

In wichwhich file can iI find the calculation that is called with random()? If it is not to much you could you also post the content in your answer.? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}

In wich file can i find the calculation that is called with random()? If it is not to much you could also post the content in your answer. I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}

In which file can I find the calculation that is called with random()? If it is not to much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.

I found this in the "WMath.cpp" but that is not the final calculation.

void randomSeed(unsigned int seed)
{
  if (seed != 0) {
    srandom(seed);
  }
}

long random(long howbig)
{
  if (howbig == 0) {
    return 0;
  }
  return random() % howbig;
}

long random(long howsmall, long howbig)
{
  if (howsmall >= howbig) {
    return howsmall;
  }
  long diff = howbig - howsmall;
  return random(diff) + howsmall;
}
Source Link
kimliv
  • 561
  • 1
  • 4
  • 17
Loading