You are here

public function IpGeoLocAPI::ipGeoLocRandom in IP Geolocation Views & Maps 8

Generate a random number uniformly distributed between supplied limits.

@ee http://php.net/manual/en/function.mt-getrandmax.php

Parameters

float $min: Pending description.

float $max: Pending description.

Return value

float Pending description.

File

src/Services/IpGeoLocAPI.php, line 835

Class

IpGeoLocAPI
Class IpGeoAPI to interact with other modules.

Namespace

Drupal\ip_geoloc\Services

Code

public function ipGeoLocRandom($min = 0, $max = 1) {
  return $min + mt_rand() / mt_getrandmax() * ($max - $min);
}