Difference between revisions of "Array.branch()"

From ZCubes Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
*[[ Z3 | << Z3 Home ]]
 
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
 
 
  
 
*[[ Z3 | << Z3 Home ]]
 
*[[ Z3 | << Z3 Home ]]

Revision as of 12:26, 4 February 2020

Array.branch(SomeOnlyMatches)

Split values into negative, zero and positive values. Return the true/false of the match result. Show all (with null for non-matches) or matches only based on SomeOnlyMatches.

[[1,-2],[3,3],[0,44,-44]].branch(true).print()

[ [ [false,true ],

[false,false ],

[false,false,true ] ],

[ [false,false ],

[false,false ],

[true,false,false ] ],

[ [true,false ],

[true,true ],

[false,true,false ] ] ]


[-5..5].branch(true)

true true true true true false false false false false false

false false false false false true false false false false false

false false false false false false true true true true true


[-5..5].branchvalues(true)

-5 -4 -3 -2 -1

0

1 2 3 4 5