lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


XenoLiz wrote:
Hm.
|   Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
|    > two,m_two=2,-2 print(-2^2, -two^2, m_two^2)
|    -4      -4      4
Why was over estimated priority?

because ^ binds higher than - and you are calculating

-(2^2) which is now and has always been -4

Ralph