Skip to content

Instantly share code, notes, and snippets.

View actarian's full-sized avatar

Luca Zampetti actarian

View GitHub Profile
@bellbind
bellbind / zeta.js
Last active January 20, 2021 17:35
[javascript]complex arith and Riemann zeta function implementations
// Complex type
var Complex = function (real, imag) {
if (real instanceof Complex) return real;
imag = imag || 0;
return Object.freeze(Object.create(Complex.prototype, {
real: {value: real, enumerable: true},
imag: {value: imag, enumerable: true},
}));
};
Complex.fromPolar = function (r, theta) {
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/