A Javascript numerical library to represent numbers as large as 10^^1e308 and as small as 10^-10^^1e308. Sequel to break_infinity.js, designed for incremental games.
As D returns the provided value as-is, it is easy to accidentally use it to create a "copy" of a Decimal and mutate it... without realising that the original Decimal was mutated too.
As a result, this commit fixes iteratedlog, slog and layeradd10 mutating the original Decimal (presumably accidentally), and prevents this from occurring in the future, as it is now a TypeScript error to mutate a value returned from D.
As D returns the provided value as-is, it is easy to accidentally use it to create a "copy" of a Decimal and mutate it... without realising that the original Decimal was mutated too.
As a result, this commit fixes iteratedlog, slog and layeradd10 mutating the original Decimal (presumably accidentally), and prevents this from occurring in the future, as it is now a TypeScript error to mutate a value returned from D.