mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 06:17:04 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -2,5 +2,5 @@ import { CONSTANTS } from "../../Constants";
|
||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||
|
||||
export function repFromDonation(amt: number, player: IPlayer): number {
|
||||
return amt / CONSTANTS.DonateMoneyToRepDivisor * player.faction_rep_mult;
|
||||
}
|
||||
return (amt / CONSTANTS.DonateMoneyToRepDivisor) * player.faction_rep_mult;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
// Then we use https://herbie.uwplse.org/demo/ to simplify it and prevent
|
||||
// Infinity issues.
|
||||
export function favorToRep(f: number): number {
|
||||
function fma(a: number, b: number, c: number): number {
|
||||
return a * b + c;
|
||||
}
|
||||
const ex = fma(f, (Math.log(51.0) - Math.log(50.0)), Math.log(51.0));
|
||||
return fma(500.0, Math.exp(ex), -25000.0);
|
||||
function fma(a: number, b: number, c: number): number {
|
||||
return a * b + c;
|
||||
}
|
||||
const ex = fma(f, Math.log(51.0) - Math.log(50.0), Math.log(51.0));
|
||||
return fma(500.0, Math.exp(ex), -25000.0);
|
||||
}
|
||||
|
||||
// Wolfram Alpha: 500 (50^(-n) 51^(n + 1) - 50) solve for n
|
||||
export function repToFavor(r: number): number {
|
||||
return -(Math.log(25500/(r + 25000)))/Math.log(51/50);
|
||||
}
|
||||
return -Math.log(25500 / (r + 25000)) / Math.log(51 / 50);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user