Skip to content

Commit

Permalink
docs(as.js): fix comment in as.vector
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayaksaxena committed Mar 24, 2024
1 parent e26083f commit ebfc3bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/as.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ as.vector = function ( tokens, rdd ) {
v[ i ] = +( v[ i ] / numOfTokens ).toFixed( precision );
l2Norm += v[ i ] * v[ i ];
}
// `l2Norm` becomes the 101th element for faster cosine similarity/normalization.
// `l2Norm` becomes the `size+1th` element for faster cosine similarity/normalization.
v.push( +( Math.sqrt( l2Norm ).toFixed( precision ) ) );

return v;
Expand Down

0 comments on commit ebfc3bd

Please sign in to comment.