Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name OM Fixer for Firefox
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description FIxes the FB per second calculation on Firefox browsers
- // @author Nyan Cat
- // @match http*://patcailmemer.github.io/Ordinal-Markup/
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- window.OPtoOrd = function OPtoOrd(x, b, trim = 0) {
- if (x <= 0.000000000001 || trim >= 12) return 0; // Change == 0 to extremely close to 0
- let exp = Math.floor(Math.log10(x) + 0.000000000001);
- if (validInBase(exp, b)) {
- let coef = Math.floor(x / 10 ** exp + 0.000000000001);
- if (coef >= b) return b ** (OPtoOrd(exp, b, trim + 1) + 1);
- return b ** OPtoOrd(exp, b, trim + 1) * coef + OPtoOrd(x - coef * 10 ** exp, b, trim + 1);
- } else {
- return b ** OPtoOrd(exp, b, trim + 1);
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement