Results 1 to 4 of 4

Thread: Raising a negative number to a power

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Aug 2015
    Posts
    17
    Rep Power
    11

    Raising a negative number to a power

    It appears that the use of parentheses in the following code gives an invalid delimiter error

    Uses "Console"
    printl (-2)^2
    WaitKey
    
    while the following alternative runs well

    Uses "Console"
    printl -2^2
    WaitKey
    
    On the other hand, the following version gives the wrong answer!

    Uses "Console"
    printl -(2)^2
    WaitKey
    
    So, something is not right with parsing such numerical expressions.
    Last edited by paravantis; 27-08-2024 at 13:05.

Similar Threads

  1. Replies: 2
    Last Post: 12-11-2017, 13:41
  2. The Power of Nightmares
    By Charles Pegge in forum Shout Box Area
    Replies: 5
    Last Post: 23-05-2012, 07:45
  3. The power of ...
    By ErosOlmi in forum Shout Box Area
    Replies: 3
    Last Post: 05-01-2012, 08:36
  4. Replies: 3
    Last Post: 09-10-2007, 21:56

Members who have read this thread: 4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •