What is the operator precedence of q?

11 Mar 2014 | , , ,
Share on:

In mathematics and specifically algebraic operations, we learn there is an order to which the calculations are made depending on brackets, powers and roots, multiplication and division, and addition and subtraction.

Answer: There is no operator precedence. Expressions are evaluated right to left.

Example: q)3*2+418

© 2017 Kx Systems
Kx® and kdb+ are registered trademarks of Kx Systems, Inc., a subsidiary of First Derivatives plc.

SUGGESTED ARTICLES

Kdb+ Mastermind Challenge

Kdb+ Mastermind Challenge

4 Oct 2017 | , , , , ,

The Kx Community NYC Meetup recently competed in a Mastermind coding competition moderated by expert kdb+ programmer Nick Psaris, author of the book “Q Tips: Fast, Scalable and Maintainable Kdb+.” The top four solutions were notable for the completely different approaches they took. Mastermind is a popular code-breaking game introduced in 1975 that pits a “codemaker” against a “codebreaker.” The “code,” represented by four pegs chosen from a universe of 6 colors, is picked by the “codemaker.” The “codebreaker” continually makes 4-peg guesses and is told by the “codemaker” how many are the correct color in the correct position, and how many are the correct color in the wrong position.

Kx for IoT in Asia with kdb+

Kx and the Internet of Things Asia

21 Apr 2017 | , , , ,

Adoption of connected devices and Internet of Things data analysis has become a compelling business imperative for companies and countries around the world. In Asia, the IoT revolution has unique characteristics reflecting the infrastructure and politics of the region. The conference is fittingly held in Singapore, which is striving to become the world’s first Smart City.

kdb+/q adverbs word cloud Nusa Znderl

Enhancing Your kdb+/q Toolkit: Real World Examples of Adverbs

12 Apr 2017 | , , , ,

Nuša Žnuderl’s latest blog post uses five real-world examples to demonstrate how kdb+/q coders can improve their results by using adverbs and not using looping constructs. Long-term the benefit is vastly improved performance from doing things in the “q way.” In her blog Nuša writes: “Similar to the English language, adverbs in q augment operations to allow an application on lists. They make code shorter, clearer and almost always more efficient than the alternative loopy modus operandi – all of which are qualities that differentiate code written by proficient q users from the rest.”