functionatan2(Y,X:real)returnreal;-- = ARCTAN(Y, X) but returns 0 when Y = X = 0, without reporting Error: ARCTAN(0.0, 0.0) is undetermined
functionto_natural_arr(n:t_integer_arr;to_zero:boolean)returnt_natural_arr;-- if to_zero=TRUE then negative numbers are forced to zero, otherwise they will give a compile range error
...
...
@@ -543,6 +547,7 @@ package common_pkg is
functionflip(a:std_logic_vector)returnstd_logic_vector;-- bit flip a vector, map a[h:0] to [0:h]
functionflip(a,w:natural)returnnatural;-- bit flip a vector, map a[h:0] to [0:h], h = w-1