Want 1/0 to be consider as 0 in my equation. How to do it?

hc = 0.0;

Dxc = 880200;
Exc = Dxc/\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(\(-hc\)/2\), \(hc/2\)]\(
\*SuperscriptBox[\(z\), \(2\)] \[DifferentialD]z\)\)

I want to calculate Dx values for different hc(core height) values. if i substitute the hc value equal to 0 then I am getting error message(1/0 infinite expression ) instead of 0 which is my requirement.

Kindly help me out to get zero instead of error message.

question.nb (3.1 KB)

Some other tools and languages provide a Divide(numerator, denominator, default) function that returns the specified default value when the denominator is 0.

So, I created my own version in the Wolfram langage.

Options[tdyDivide] = {
   "default" -> 0., 
   "precision" -> 2
   };
tdyDivide[numerator_?NumericQ, denominator_?NumericQ, 
   OptionsPattern[]] := 
  N[
   If[
    denominator !=  0.,
    numerator / denominator,
    OptionValue["default"]
    ],
   OptionValue["precision"]
   ];

I’m still building unit tests for this. So, if you find any issues, please let me know.

thanks

You can avoid the singularity by first determining the integral expression and do the division later on

int = \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(\(-hc\)/2\), \(hc/2\)]\(
\*SuperscriptBox[\(z\), \(2\)] \[DifferentialD]z\)\)

Exc = Dxc/ int