From 9d184f944a7acc03ba5f7a14136939cfc669d4b7 Mon Sep 17 00:00:00 2001 From: nj4710 Date: Thu, 19 May 2016 21:26:30 +0530 Subject: [PATCH 1/5] Create Python-Function-POW.md For issue #819 --- Python-Function_POW.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Python-Function_POW.md diff --git a/Python-Function_POW.md b/Python-Function_POW.md new file mode 100644 index 000000000..d7bc4965c --- /dev/null +++ b/Python-Function_POW.md @@ -0,0 +1,21 @@ +# Python 'pow(x,y)' + +pow(x, y[, z]) is a built in function in Python 3 to calculate x to the power y and if z is present , returns x to the power y modulo [https://processing.org/reference/modulo.html] z + +#Argument +The arguments must have numeric types. +It takes two argument x and y as well as three x,y and z. +If z is present, x and y must be of integer types, and y must be non-negative. + + +##Return +If z is present it returns x to the power y modulo z.If only x and y are present it returns x to the power y (same as x**y). +It is much faster than x**y % z. + + +##Code Sample +print(pow(2,4)) # prints 16 +print(pow(10,-2)) # prints 0.01 +print(pow(4,3,5)) #prints 4 + +[official docs]https://docs.python.org/3/library/functions.html#pow From 44d97b23e7878330e55a7e02736e5658abe3912b Mon Sep 17 00:00:00 2001 From: nj4710 Date: Fri, 20 May 2016 00:48:56 +0530 Subject: [PATCH 2/5] Update and rename Python-Function_POW.md to Python-Function-Pow.md --- Python-Function-Pow.md | 22 ++++++++++++++++++++++ Python-Function_POW.md | 21 --------------------- 2 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 Python-Function-Pow.md delete mode 100644 Python-Function_POW.md diff --git a/Python-Function-Pow.md b/Python-Function-Pow.md new file mode 100644 index 000000000..19bc66c12 --- /dev/null +++ b/Python-Function-Pow.md @@ -0,0 +1,22 @@ +# Python pow(x,y) + +'pow(x, y[, z])' is a built-in function in Python 3 to calculate 'x' to the power 'y' and if 'z' is present , returns 'x' to the power 'y' [modulo](https://processing.org/reference/modulo.html) 'z' + +## Arguments +The arguments must have numeric types. +This function takes two arguments, 'x' and 'y', as well as three, 'x','y' and 'z'. +If 'z' is present, 'x' and 'y' must be of integer types, and y must be non-negative. + + +## Return +If 'z' is present it returns 'x' to the power 'y' modulo 'z'.If only 'x' and 'y' are present it returns 'x' to the power 'y' (same as x**y). + + + +## Example +'''python +print(pow(2,4)) # prints 16 +print(pow(10,-2)) # prints 0.01 +print(pow(4,3,5)) # prints 4 +''' +[Official Documentation](https://docs.python.org/3/library/functions.html#pow) diff --git a/Python-Function_POW.md b/Python-Function_POW.md deleted file mode 100644 index d7bc4965c..000000000 --- a/Python-Function_POW.md +++ /dev/null @@ -1,21 +0,0 @@ -# Python 'pow(x,y)' - -pow(x, y[, z]) is a built in function in Python 3 to calculate x to the power y and if z is present , returns x to the power y modulo [https://processing.org/reference/modulo.html] z - -#Argument -The arguments must have numeric types. -It takes two argument x and y as well as three x,y and z. -If z is present, x and y must be of integer types, and y must be non-negative. - - -##Return -If z is present it returns x to the power y modulo z.If only x and y are present it returns x to the power y (same as x**y). -It is much faster than x**y % z. - - -##Code Sample -print(pow(2,4)) # prints 16 -print(pow(10,-2)) # prints 0.01 -print(pow(4,3,5)) #prints 4 - -[official docs]https://docs.python.org/3/library/functions.html#pow From c4cb6179a6481dbf985556daa1545add5a6d5eae Mon Sep 17 00:00:00 2001 From: nj4710 Date: Fri, 20 May 2016 00:53:54 +0530 Subject: [PATCH 3/5] Update Python-Function-Pow.md --- Python-Function-Pow.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Python-Function-Pow.md b/Python-Function-Pow.md index 19bc66c12..a2df77496 100644 --- a/Python-Function-Pow.md +++ b/Python-Function-Pow.md @@ -1,22 +1,22 @@ # Python pow(x,y) -'pow(x, y[, z])' is a built-in function in Python 3 to calculate 'x' to the power 'y' and if 'z' is present , returns 'x' to the power 'y' [modulo](https://processing.org/reference/modulo.html) 'z' +`pow(x, y[, z])` is a built-in function in Python 3 to calculate `x` to the power `y` and if `z` is present , returns `x` to the power `y` [modulo](https://processing.org/reference/modulo.html) `z` ## Arguments The arguments must have numeric types. -This function takes two arguments, 'x' and 'y', as well as three, 'x','y' and 'z'. -If 'z' is present, 'x' and 'y' must be of integer types, and y must be non-negative. +This function takes two arguments, `x` and `y`, as well as three, `x`,`y` and `z`. +If `z` is present, `x` and `y` must be of integer types, and y must be non-negative. ## Return -If 'z' is present it returns 'x' to the power 'y' modulo 'z'.If only 'x' and 'y' are present it returns 'x' to the power 'y' (same as x**y). +If `z` is present it returns `x` to the power `y` modulo `z`.If only `x` and `y` are present it returns `x` to the power `y` (same as x**y). ## Example -'''python +```python print(pow(2,4)) # prints 16 print(pow(10,-2)) # prints 0.01 print(pow(4,3,5)) # prints 4 -''' +``` [Official Documentation](https://docs.python.org/3/library/functions.html#pow) From 71c6ba263227150a794cb329aaa8936a94558e05 Mon Sep 17 00:00:00 2001 From: nj4710 Date: Fri, 20 May 2016 08:51:27 +0530 Subject: [PATCH 4/5] Update Python-Function-Pow.md --- Python-Function-Pow.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Python-Function-Pow.md b/Python-Function-Pow.md index a2df77496..78bb3e83b 100644 --- a/Python-Function-Pow.md +++ b/Python-Function-Pow.md @@ -3,20 +3,25 @@ `pow(x, y[, z])` is a built-in function in Python 3 to calculate `x` to the power `y` and if `z` is present , returns `x` to the power `y` [modulo](https://processing.org/reference/modulo.html) `z` ## Arguments + The arguments must have numeric types. This function takes two arguments, `x` and `y`, as well as three, `x`,`y` and `z`. If `z` is present, `x` and `y` must be of integer types, and y must be non-negative. ## Return + If `z` is present it returns `x` to the power `y` modulo `z`.If only `x` and `y` are present it returns `x` to the power `y` (same as x**y). ## Example + ```python print(pow(2,4)) # prints 16 print(pow(10,-2)) # prints 0.01 print(pow(4,3,5)) # prints 4 ``` +:rocket: [REPL It!](https://repl.it/CTGi) + [Official Documentation](https://docs.python.org/3/library/functions.html#pow) From 530b819b873912b74dc61963f8997389ccb49f87 Mon Sep 17 00:00:00 2001 From: nj4710 Date: Fri, 20 May 2016 09:33:18 +0530 Subject: [PATCH 5/5] Update Python-Function-Pow.md --- Python-Function-Pow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python-Function-Pow.md b/Python-Function-Pow.md index 78bb3e83b..36fe0ea23 100644 --- a/Python-Function-Pow.md +++ b/Python-Function-Pow.md @@ -22,6 +22,6 @@ print(pow(2,4)) # prints 16 print(pow(10,-2)) # prints 0.01 print(pow(4,3,5)) # prints 4 ``` -:rocket: [REPL It!](https://repl.it/CTGi) +:rocket: [Run Code](https://repl.it/CTGi) [Official Documentation](https://docs.python.org/3/library/functions.html#pow)