mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-15 11:54:02 +02:00
Documented xor() function.
This commit is contained in:
@@ -160,4 +160,5 @@ function mapi(v, func) = [ for (i = [0:len(v)-1]) func(i,v[i]) ]; //! make a new
|
||||
function reduce(v, func, unity) = let ( r = function(i,val) i == len(v) ? val : r(i + 1, func(val, v[i])) ) r(0, unity); //! reduce a vector v to a single entity by applying the func function recursively to the reduced value so far and the next element, starting with unity as the initial reduced value
|
||||
function sumv(v) = reduce(v, function(a, b) a + b, 0); //! sum a vector of values that can be added with "+"
|
||||
|
||||
function xor(a,b) = (a && !b) || (!a && b);
|
||||
function xor(a,b) = (a && !b) || (!a && b); //! Logical exclusive OR
|
||||
function cuberoot(x)= sign(x)*abs(x)^(1/3);
|
||||
|
Reference in New Issue
Block a user