Jump to content
Larry Ullman's Book Forums

Script 9.5 And Abs (Absolute Value)


Recommended Posts

Hi Larry,

 

When I tried to run script 9.5 - rational.cpp, my Dev-C++ IDE gave me an error re lines 131 and 132 (approx.) where abs is used in the normalize method.

 

I had to add #include <stdlib.h> and then everything worked OK.

 

Just FYI.

 

Cheers from Oz.

Link to comment
Share on other sites

Probably due to a different IDE. In a separate post I described a problem that I had with exercises 6.2 and 6.3 and the solution that worked for me in my Dev-C++ version 5.8.3 IDE which seems to use the TDM-GCC compiler version 4.8.1, 64 bit, in my environment.

 

However, later on I tried the same exercise 6.2 in an MS Visual C++ 2008 Express Edition IDE and it ran fine as per the script in your book.

 

As per "The King of Siam": 'Tis a puzzlement!

 

Cheers from Oz.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...