4 ms·
>function Gcd(a:nat, b:nat) : (g:nat,x:int,y:int)) I hope this is a typo. Otherwise it…requires an unmatched close paren? That's a new level of cursed syntax.
by snitty 3y ago
>function Gcd(a:nat, b:nat) : (g:nat,x:int,y:int))
I hope this is a typo. Otherwise it…requires an unmatched close paren?
That's a new level of cursed syntax.
EDIT: Also, is |array| a common way to get the length of an array in languages? I've never seen that (or some of this other syntax) before and it took me a minute to figure out what was happening.
- jbl 3y ago|array| looks like it’s taken from the notation for cardinality of a set (number of elements in a set)
- snitty 3y agoThat makes sense. I initially read it as "absolute value." Which, admittedly, doesn't make sense for an array, but is a reasonable interpretation at first blush.
- hdctambien 3y agoI don't know about programming languages, but in mathematics |v| is the notation to get the length of a vector... So maybe Matlab uses that syntax?
- deleted 3y ago[deleted]
- RGBCube 3y agoFYI, MATLAB uses `length(v)` to get the length of vector v.
- deleted 3y ago[deleted]
- redjamjar 3y ago> I hope this is a typo Yeah, sorry --- that is a typo.