Skip to main content
Became Hot Network Question
edited title
Link
user64494
  • 29.1k
  • 4
  • 29
  • 56

How to replace Divide in an expression?

edited tags
Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489
Source Link

How to replace Divide in an expression

It seems that a/b is always replaced with the form: a * b^-1, Times[a, Power[b, -1]]. I tried Hold, Unevaluated, HoldAll and this always happens.

Thus a/b /. {Times -> Minus} leads to a - b^-1 and any_expression /. {Divide -> Minus} is always unchanged

How can I replace Divide in a/b with Minus to get a-b?