You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/numbers.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
##INTEGERS (NAMBA) AND FLOATS (DESIMALI)
1
+
# INTEGERS (NAMBA) AND FLOATS (DESIMALI)
2
2
3
3
Integers and floats are the basic numeric data types in Nuru, used for representing whole numbers and decimal numbers, respectively. This page covers the syntax and usage of integers and floats in Nuru, including precedence, unary increments, shorthand assignments, and negative numbers.
4
4
5
-
###PRECEDENCE
5
+
## PRECEDENCE
6
6
7
7
Integers and floats behave as expected in mathematical operations, following the BODMAS rule:
8
8
```go
@@ -14,7 +14,7 @@ fanya b = 3/5
14
14
a + b // 2.8
15
15
```
16
16
17
-
###UNARY INCREMENTS
17
+
## UNARY INCREMENTS
18
18
19
19
You can perform unary increments (++ and --) on both floats and integers. These will add or subtract 1 from the current value. Note that the float or int have to be assigned to a variable for this operation to work. Here's an example:
20
20
@@ -24,7 +24,7 @@ fanya i = 2.4
24
24
i++ // 3.4
25
25
```
26
26
27
-
###SHORTHAND ASSIGNMENT
27
+
## SHORTHAND ASSIGNMENT
28
28
29
29
Nuru supports shorthand assignments with +=, -=, /=, *=, and %=:
Copy file name to clipboardExpand all lines: docs/en/operators.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
##OPERATORS
1
+
# OPERATORS
2
2
Operators are the foundation of any programming language, allowing you to perform various operations on variables and values. This page covers the syntax and usage of operators in Nuru, including assignment, arithmetic, comparison, member, and logic operators.
3
3
4
-
###ASSIGNMENT
4
+
## ASSIGNMENT
5
5
6
6
Assuming `i` and `v` are predefined variables, Nuru supports the following assignment operators:
7
7
@@ -17,7 +17,7 @@ For `strings`, `arrays` and `dictionaries`, the `+=` sign operator is permissibl
17
17
list1 += list2 // this is equivalent to list1 = list1 + list2
18
18
```
19
19
20
-
###ARITHMETIC OPERATORS
20
+
## ARITHMETIC OPERATORS
21
21
22
22
Nuru supports the following arithmetic operators:
23
23
@@ -28,7 +28,7 @@ Nuru supports the following arithmetic operators:
28
28
-`%`: Modulo (ie the remainder of a division)
29
29
-`**`: Exponential power (eg: `2**3 = 8`)
30
30
31
-
###COMPARISON OPERATORS
31
+
## COMPARISON OPERATORS
32
32
33
33
Nuru supports the following comparison operators:
34
34
@@ -39,7 +39,7 @@ Nuru supports the following comparison operators:
39
39
-`<`: Less than
40
40
-`<=`: Less than or equal to
41
41
42
-
###MEMBER OPERATOR
42
+
## MEMBER OPERATOR
43
43
44
44
The member operator in Nuru is `ktk`. It will check if an object exists in another object:
0 commit comments