math.pow
Return x raised to the yth power. This is equivalent to the operator ^
.
|
|||
Read a line from the user, then print two raised to that number. | |||
Code | <nowiki>
print(math.pow(2, tonumber(read())))
</nowiki>
|
||
Output | Depends on what the user wrote. For instance, if they were to enter 5 , the value printed would be 32 . |
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Lua |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CC:Tweaked |
|
math.pow Function | |
---|---|
Syntax math.pow(
| |
Returns | number |
API | math |
Source | Lua (source) |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.