Skip to content

Commit

Permalink
add docs for v0.22.0
Browse files Browse the repository at this point in the history
Signed-off-by: Flipez <code@brauser.io>
  • Loading branch information
Flipez committed Sep 30, 2023
1 parent bbc93c2 commit 0d64fb8
Show file tree
Hide file tree
Showing 34 changed files with 2,804 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/versioned_docs/version-v0.22.0/builtins/HTTP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import CodeBlockSimple from '@site/components/CodeBlockSimple'

# HTTP




## Module Function

### new()
> Returns `HTTP`
Creates a new instance of HTTP






## Properties
| Name | Value |
| ---- | ----- |

25 changes: 25 additions & 0 deletions docs/versioned_docs/version-v0.22.0/builtins/IO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import CodeBlockSimple from '@site/components/CodeBlockSimple'

# IO




## Module Function

### open(STRING, STRING, STRING)
> Returns `FILE`
Opens a file pointer to the file at the path, mode and permission can be set optionally.


<CodeBlockSimple input='IO.open("main.go", "r", "0644")
' output='<file:main.go>
' />



## Properties
| Name | Value |
| ---- | ----- |

27 changes: 27 additions & 0 deletions docs/versioned_docs/version-v0.22.0/builtins/JSON.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import CodeBlockSimple from '@site/components/CodeBlockSimple'

# JSON




## Module Function

### parse(STRING)
> Returns `HASH`
Takes a STRING and parses it to a HASH or ARRAY. Numbers are always FLOAT.


<CodeBlockSimple input='JSON.parse(&apos;{"test": 123}&apos;)
JSON.parse(&apos;["test", 123]&apos;)
' output='{"test": 123.0}
["test", 123.0]
' />



## Properties
| Name | Value |
| ---- | ----- |

254 changes: 254 additions & 0 deletions docs/versioned_docs/version-v0.22.0/builtins/Math.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
import CodeBlockSimple from '@site/components/CodeBlockSimple'

# Math




## Module Function

### abs(FLOAT)
> Returns `FLOAT`






### acos(FLOAT)
> Returns `FLOAT`
Returns the arccosine, in radians, of the argument


<CodeBlockSimple input='Math.acos(1.0)
' output='0.0
' />


### asin(FLOAT)
> Returns `FLOAT`
Returns the arcsine, in radians, of the argument


<CodeBlockSimple input='Math.asin(0.0)
' output='0.0
' />


### atan(FLOAT)
> Returns `FLOAT`
Returns the arctangent, in radians, of the argument


<CodeBlockSimple input='Math.atan(0.0)
' output='0.0
' />


### ceil(FLOAT)
> Returns `FLOAT`
Returns the least integer value greater or equal to the argument


<CodeBlockSimple input='Math.ceil(1.49)
' output='2.0
' />


### copysign(FLOAT, FLOAT)
> Returns `FLOAT`
Returns a value with the magnitude of first argument and sign of second argument


<CodeBlockSimple input='Math.copysign(3.2, -1.0)
' output='-3.2
' />


### cos(FLOAT)
> Returns `FLOAT`
Returns the cosine of the radion argument


<CodeBlockSimple input='Math.cos(Pi/2)
' output='0.0
' />


### exp(FLOAT)
> Returns `FLOAT`
Returns e**argument, the base-e exponential of argument


<CodeBlockSimple input='Math.exp(1.0)
' output='2.72
' />


### floor(FLOAT)
> Returns `FLOAT`
Returns the greatest integer value less than or equal to argument


<CodeBlockSimple input='Math.floor(1.51)
' output='1.0
' />


### log(FLOAT)
> Returns `FLOAT`
Returns the natural logarithm of argument


<CodeBlockSimple input='Math.log(2.7183)
' output='1.0
' />


### log10(FLOAT)
> Returns `FLOAT`
Returns the decimal logarithm of argument


<CodeBlockSimple input='Math.log(100.0)
' output='2.0
' />


### log2(FLOAT)
> Returns `FLOAT`
Returns the binary logarithm of argument


<CodeBlockSimple input='Math.log2(256.0)
' output='8.0
' />


### max(FLOAT, FLOAT)
> Returns `FLOAT`
Returns the larger of the two numbers


<CodeBlockSimple input='Math.max(5.0, 10.0)
' output='10.0
' />


### min(FLOAT, FLOAT)
> Returns `FLOAT`
Returns the smaller of the two numbers


<CodeBlockSimple input='Math.min(5.0, 10.0)
' output='5.0
' />


### pow(FLOAT, FLOAT)
> Returns `FLOAT`
Returns argument1**argument2, the base-argument1 exponential of argument2


<CodeBlockSimple input='Math.pow(2.0, 3.0)
' output='8.0
' />


### rand()
> Returns `FLOAT`
Returns a pseudo-random number in the half-open interval [0.0, 1.0].


<CodeBlockSimple input='Math.rand()
' output='0.6046602879796196
' />


### remainder(FLOAT, FLOAT)
> Returns `FLOAT`
Returns the IEEE 754 floating-point remainder of argument1/argument2


<CodeBlockSimple input='Math.remainder(100.0, 30.0)
' output='10.0
' />


### round(FLOAT)
> Returns `FLOAT`
Returns the nearest integer, rounding half away from zero


<CodeBlockSimple input='Math.round(73.3)
' output='73.0
' />


### sin(FLOAT)
> Returns `FLOAT`
Returns the sine of the radion argument


<CodeBlockSimple input='Math.sin(Pi)
' output='0.0
' />


### sqrt(FLOAT)
> Returns `FLOAT`
Returns the square root of argument


<CodeBlockSimple input='Math.sqrt(3.0 * 3.0 + 4.0 * 4.0)
' output='5.0
' />


### tan(FLOAT)
> Returns `FLOAT`
Returns the tangent of the radion argument


<CodeBlockSimple input='Math.tan(0.0)
' output='0.0
' />



## Properties
| Name | Value |
| ---- | ----- |
| E | 2.718281828459045 |
| Ln10 | 2.302585092994046 |
| Ln2 | 0.6931471805599453 |
| Log10E | 0.4342944819032518 |
| Log2E | 1.4426950408889634 |
| Phi | 1.618033988749895 |
| Pi | 3.141592653589793 |
| Sqrt2 | 1.4142135623730951 |
| SqrtE | 1.6487212707001282 |
| SqrtPhi | 1.272019649514069 |
| SqrtPi | 1.772453850905516 |

37 changes: 37 additions & 0 deletions docs/versioned_docs/version-v0.22.0/builtins/OS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import CodeBlockSimple from '@site/components/CodeBlockSimple'

# OS




## Module Function

### exit(INTEGER)
> Returns ``
Terminates the program with the given exit code.


<CodeBlockSimple input='OS.exit(1)
' output='exit status 1
' />


### raise(INTEGER, STRING)
> Returns ``
Terminates the program with the given exit code and prints the error message.


<CodeBlockSimple input='OS.raise(1, "broken")
' output='🔥 RocketLang raised an error: "broken"
exit status 1
' />



## Properties
| Name | Value |
| ---- | ----- |

Loading

2 comments on commit 0d64fb8

@vercel
Copy link

@vercel vercel bot commented on 0d64fb8 Sep 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 0d64fb8 Sep 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.