rand() public static method

Returns a NumArray filled with random values
Since: 1.0.0
public static rand ( ) : NumArray
return NumArray
示例#1
0
 /**
  * Tests NumPHP::rand
  */
 public function testRand3()
 {
     $rand = NumPHP::rand(3);
     $this->assertInstanceOf('\\NumPHP\\Core\\NumArray', $rand);
     $this->assertSame([3], $rand->getShape());
     $randData = $rand->getData();
     $this->assertCount(3, $randData);
     foreach ($randData as $entry) {
         $this->assertInternalType('float', $entry);
     }
 }