Skip to main content
1-Visitor
October 4, 2014
Question

I have some questions

  • October 4, 2014
  • 2 replies
  • 1371 views

Hello I write to want to know about my question.

%EC%BA%A1%EC%B2%98.PNG

I have a problem. you can know to a picture on upper.

I read error massage and I knew why error is generated.

error is said that it is not possible to divide 'zero'.

Could I slove following error?

I attached my files.

Thank you for reading my question

2 replies

25-Diamond I
October 4, 2014

While the best way probably is to avoid my=0 alltogether, another workaround is the redefinition of the function b() so it catches the error and returns a dummy result or, as shown below, a NaN (Not-a-Number).

1.png

jlee-21-VisitorAuthor
1-Visitor
October 8, 2014

Thank you for consideration.

I knew method that I want to know for you

19-Tanzanite
October 4, 2014

You get a divide by zero either when mu=0 or when mu=1. It's clear that as mu approaches 1, b(mu) approaches 0, so that's easy to fix. However, as mu approaches 0, b(mu) rises asymptotically to infinity, and when mu =0, b(mu) is undefined. So the real solution is to not calculate b(mu) for mu =0, because it's meaningless. If you don't want to do that, then make the function return NaN for mu=0.

jlee-21-VisitorAuthor
1-Visitor
October 8, 2014

Thank you.

I got help due to you.