News for hackers. Stuff that matters.
Re:Show HN: Calc, a simple command-line calulator in C by vivekkannan on Tuesday June 09, 2015 @07:46AM (#9685269)
I checked division by zero initially, but then realised that 1/0 causes double to represent inf. Thought that this could be useful(?) in some situations. For example, atan(1/0) --> 1.57... instead of error.
Re:Show HN: Calc, a simple command-line calulator in C by jhallenworld on Tuesday June 09, 2015 @08:58AM (#9685589)
I was thinking to catch errors which could crash the program. Actually you should install a signal handler for SIGFPE to take care of this.