Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Log[17]/Log[2] -> Log2[17]
- Log[13]/Log[10] -> Log10[13]
- Log[99]/Log[11] -> Log[11, 99]
- $PrePrint = # /. {
- Log[n_]/Log[2] :> Defer @ Log2[n],
- Log[n_]/Log[10] :> Defer @ Log10[n],
- Log[n_]/Log[b_] :> Defer @ Log[b, n]
- } &;
- MakeBoxes[Log[n_]/Log[2], fmt_] := ToBoxes[Defer @ Log2[n], fmt]
- MakeBoxes[Log[n_]/Log[10], fmt_] := ToBoxes[Defer @ Log10[n], fmt]
- MakeBoxes[Log[n_]/Log[b_], fmt_] := ToBoxes[Defer @ Log[b, n], fmt]
- Unprotect[Times];
- Format[Log[n_]/Log[2]] := Defer @ Log2[n]
- Format[Log[n_]/Log[10]] := Defer @ Log10[n]
- Format[Log[n_]/Log[b_]] := Defer @ Log[b, n]
- Protect[Times];
- SetSystemOptions["SimplificationOptions" -> "AutosimplifyTwoArgumentLog" -> False];
- logRule = Log[x_]/Log[b_] :> Switch[b, 2, Log2[x], 10, Log10[x], _, Log[b, x]];
- {Log[17]/Log[2], Log[13]/Log[10], Log[99]/Log[11]} /. logRule
- {Log2[17], Log10[13], Log[11, 99]}
- Expand[(Log[17] + Log[4])/Log[10]] /. logRule
- Log10[4] + Log10[17]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement