Check out example codes for "Runtime Error: Runtime ErrorFloating-point exception (SIGFPE". It will help you in understanding the concepts better.

Code Example 1

I keep getting SIGFPE error when i try to run my program. 
Why so? This is the easiest runtime error to debug -
it is a floating point error. It is virtually always
caused by a division by 0, so check any divisions or 
modulo operations in your code carefully.

Learn ReactJs, React Native from akashmittal.com