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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...