qorf / quorum-language

The primary repository for the Quorum Programming Language
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

exponentiation opporator #90

Open locdly opened 10 months ago

locdly commented 10 months ago

Bug Report: Missing Exponentiation Operator (^) in Quorum Programming Language

Summary: The Quorum programming language currently lacks a simple exponentiation operator (^) for performing mathematical power operations. This absence makes it less intuitive for users who are accustomed to using the ^ operator in other programming languages.

Description: Currently, Quorum does not support the common ^ operator for exponentiation, unlike many other programming languages. This operator is a standard mathematical symbol that users often expect to use for raising numbers to a power. Instead, users are required to use the power() function for exponentiation, which can be less familiar and more verbose.

Expected Behavior: It would be beneficial for the Quorum programming language to include a simple ^ operator for exponentiation, consistent with common mathematical notation and many other programming languages. This would improve the language's user-friendliness and alignment with established mathematical conventions.

Steps to Reproduce:

  1. Attempt to use the ^ operator for exponentiation in a Quorum code snippet.
  2. Observe that the ^ operator is not recognized, leading to a syntax error.

Current Workaround: To perform exponentiation in Quorum, users need to use the power() function. For example:

Suggested Solution: Implement the ^ operator for exponentiation in the Quorum programming language, providing users with a more intuitive and familiar way to perform power operations.

Additional Notes: This change should be accompanied by appropriate updates to the Quorum language documentation and examples to reflect the newly introduced ^ operator.

Environment: Quorum IDE

Thank you for considering this enhancement to the Quorum programming language. Your efforts in making Quorum more user-friendly are greatly appreciated!

Best regards, Loc Ly

andreas-stefik commented 9 months ago

Hey there,

Thanks for the suggestion. We haven't gathered any evidence on this particular operator (e.g., alternative symbols), but will consider it for a future version and keep this bug around to mark whether we do it.

Stefik