p function

Synopsis

bool p(float prob)

Parameters

Returns

true or false, depending on prob and the current shape's seedian. if prob < 0, false is returned, and if prob > 1, true is returned.

 

This function returns true with probablity prob, or in other words, it returns false with probability (1 - prob).

Related

Examples

example.1
	p(0.5)
	# result = true with probability 0.5
	# result = false with probability 0.5

example.2
	p(0.3)
	# result = true with probability 0.3
	# result = false with probability 0.7

example.3
	p(1)
	# result = true	 
   
example.4
	p(0)
	# result = false	    

example.5
	p(2)
	# result = true	    

example.6
	p(-1)
	# result = false	    
	

Copyright ©2008-2017 Esri R&D Center Zurich. All rights reserved.