Skip to main content
1-Visitor
Oct 4, 2014 11:50 AM UTC
Question

I have some questions

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

4 replies

Werner_E
25-Diamond I
Oct 4, 2014 1:21 PM UTC

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

Translate
jlee-21-VisitorAuthor
1-Visitor
Oct 8, 2014 8:49 AM UTC

Thank you for consideration.

I knew method that I want to know for you

Translate
19-Tanzanite
Oct 4, 2014 1:28 PM UTC

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.

Translate
jlee-21-VisitorAuthor
1-Visitor
Oct 8, 2014 8:50 AM UTC

Thank you.

I got help due to you.

Translate