logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

number-expressions - Golf documentation (numbers)

Description

A number expression uses operators plus (+), minus (-), multiply (*), divide (/) and modulus (%), as well as parenthesis (). For example: set-number n1 = 10+(4*n2-5)%3 You can use number expressions anywhere number is expected as an input to any statement. Note that character constants (such as 'A', 'z' etc.) are considered numbers with the value equal to their single-byte ASCII equivalent (i.e. unsigned numbers 0-255), for example this will assign 65 to "num": set-number num = 'A' Any subscripted string is also considered a number, for instance "num" would be 117 (since 's' is 115): set-string str = 'some' set-number num = str[0] + 2 Other than decimals and character constants, you can also use hexadecimal numbers (such as 0xffaa), and octal numbers (such as 0710).

Name

number-expressions - Golf documentation (numbers)

See Also

Numbers abs-numbernumber-expressionsnumber-stringset-numberstring-number See all documentation $DATE $VERSION GOLF(2gg)

See Also