Thread: Relational and logical operator combination bug

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2020
    Posts
    5

    Relational and logical operator combination bug

    I have written a simple program that approximates value of a Maclaurin series.

    The source file is attached here because I could not make the wrap code feature work while posting.

    I want to stop the while loop based on a test which goes something like this:
    while( iterations < max iterations or aboslute_error < specified_error)

    But the error comparison test never kicks in. However, when I remove the iterations test the error test works.

    I know that it is something really fundamental that I have not taken into account. Do you think it is operator precedence that needs to be looked at ?

    Can someone please point out what's going wrong?
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Logical not operator
    By abhi143 in forum C Programming
    Replies: 5
    Last Post: 10-29-2017, 11:25 AM
  2. logical operator
    By acpower in forum C Programming
    Replies: 5
    Last Post: 04-16-2012, 02:43 AM
  3. logical operator !
    By scrapper in forum C Programming
    Replies: 1
    Last Post: 02-18-2005, 08:30 AM
  4. Logical Operator not working?
    By xshapirox in forum C++ Programming
    Replies: 2
    Last Post: 09-27-2004, 05:21 AM
  5. Relational and Logical Operators
    By GSLR in forum C Programming
    Replies: 2
    Last Post: 03-03-2002, 04:33 PM

Tags for this Thread