MCPcopy
hub / github.com/Theodeus/tuna / sign

Function sign

tuna.js:202–208  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

200}
201
202function sign(x) {
203 if (x === 0) {
204 return 1;
205 } else {
206 return Math.abs(x) / x;
207 }
208}
209
210function tanh(n) {
211 return (Math.exp(n) - Math.exp(-n)) / (Math.exp(n) + Math.exp(-n));

Callers 1

tuna.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected