Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning Objective-C. Using Xcode 3.2.1. What is error: Program received signal: “EXC_ARITHMETIC”

I am learning Objective-C using Stephen Kochan's excellent book "Programming in Objective-C 2.0". I am new also to Xcode. So far all my exercises have worked fine, but when I run program 7.6 FractionTest on page 153 I get the console message "Program received signal: "EXC_ARITHMETIC". The status shows that the program succeeded, but I don't see any output. Can anybody suggest what I might be doing wrong?

like image 756
Derry Avatar asked Apr 02 '26 05:04

Derry


1 Answers

Check that if the denominator is zero (i.e. a divide-by-zero error).


EXC_ARITHMETIC (SIGFPE) is signaled when the CPU detects an invalid calculation. Some causes include divide by zero, integer overflow, etc., and integer divide by zero is most likely the reason since you're implementing a Fraction class.

like image 102
kennytm Avatar answered Apr 03 '26 22:04

kennytm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!