manifold/common/util/math.ts
James Grugett ec49a73c74
Algo feed (#77)
* Implement algo feed

* Remove 'See more...' from feed items

* Fix problem with useUpdatedContracts.

* Tweak some params
2022-04-09 18:10:58 -05:00

7 lines
201 B
TypeScript

export const logInterpolation = (min: number, max: number, value: number) => {
if (value <= min) return 0
if (value >= max) return 1
return Math.log(value - min + 1) / Math.log(max - min + 1)
}