Post by mattiamarziali22/Admin on Feb 13, 2016 14:07:53 GMT
Ok guys so here's my library. It's source code it's open to you so you can modify it and test everything.
-Code removed due to ridiculous large posts-
Now lets talk of what this thing is really about
We have these functions
-pcheck which checks if a number is prime or not. It also has 1
Example:pcheck(4);
it will show off "Not Prime"
-succ Will show the succesor of a number
Example succ(5);
will show on the screen "6"
-pred Will show the predecesor of the number
Example pred(4)
will show on the screen "3"
-prednsucc
it's like functions pred() and succ() toghether
Example:I don't feel like you need an example
-tillto This will show you all the numbers from 1 to the parameter
Example: tillto(3) will show on 1 2 3
-fromto This will show all the number from the parameter to ∞
Example fromto(2) will show on screen 2 3 4 5 6 7 8 9...
WARNING!!!! This will never stop!!!
-fromtotillto will show all numbers from the first parameter to the second parameter
Example:fromtotillto(5,8) will show off on the screen 5 6 7 8
Also I insalled myself a BrandNew Source Code Formatter so you guys can see everything as it is !
-gsum will show on the screen the result of 1+2+3+4+...+parameter
Example:gsum(4) will show on the screen 10
-sum Makes the sum of the first parameter and the second
Example sum(5,7) will show on the screen 12
-subt Makes the subtraction between the first and the second parameter
Example: subtr(5,3) will show on the screen 2
-multpl It multiplies the first parameter with the second
Example mulptl(2,3) will show on the screen 6
-mod will show the modulo of the first parameter divided to the second
Example mod(3,2) will show on the screen 1
-divs It's the Not-So-Exact division and it return the first parameter divided at the second as an int variable;
Example:divs(4.3) will show on the screen 1
-exdiv it show the exact div between the first p and the second
Example:exdiv(4,3) will show on the screen 1,3333
-console_log Shows a message on the screen
Example console_log("Hello") will show on the screen Hello
-cmmdc It will find the biggest number wich divides both parameters!
Exmaple: cmmdc(2,4) will show on screen 2 because 2 is the biggest number which divides bots parameters! (2/2=1;4/2=2)
-cmmmc It will find the smallest common multiple of the 2 parameters.
Exmaple: cmmmc(5,7) will show on the screen 35 because is the smallest common multiple of 5 and 7;
-minimum Will shiw on the screen the smallest number from the 2 parameters
Exmaple: minimum(1,2) Will show on the screen 2 because 2>1
-maximum Will show on the screen the biggest number from the 2 parameters
Example:maximum(12,13) Will show on the screen 13 because 13>12;
-pow Is power
Example: pow(2,2) will show on the screen 4 because 22=4
-sqr Finds the square root of the parameter
Exmaple:sqr(4) will show on the screen 2 beacuse √(4)=2
Prefixes! This is now part of my library! There are at the moment 2 prefixes! With Return and With Cout
Also all the prefixes are limited by a bar (_) from the name of the function.
Examples:
WrNc_pcheck(5)
This is WIth Return(Wr) and No Cout(Nc)
Also because 5 is a prime number it will return 1 which means true!
NrWc_pcheck(5)
This is the default function!
Also if you dont understand prefixes you can still use the main function!
This means pcheck(5) will still work (pcheck(5) works the same as NrWc_pcheck(5))
-oppnum() It shows the opposite of the number
Example:oppnum(10) will show off -10!
Also i have fixed the div() function by renaming it divs()!
-isbigger() It returns 1 if the first parameter is bigger than the second else it returns 0.
Example: isbigger(5,3)=1
-issmaller() It returns 1 if the first parameter is smaller than the second else it returns 0.
Example: isbigger(3,5)=1
-isequal() It returns 1 if the first parameter is equal than the second else it returns 0.
Example: isequal(5,5)=1
For now that's all but stay tuned as more updates will come!
-Code removed due to ridiculous large posts-
Now lets talk of what this thing is really about
We have these functions
-pcheck which checks if a number is prime or not. It also has 1
Example:pcheck(4);
it will show off "Not Prime"
-succ Will show the succesor of a number
Example succ(5);
will show on the screen "6"
-pred Will show the predecesor of the number
Example pred(4)
will show on the screen "3"
-prednsucc
it's like functions pred() and succ() toghether
Example:I don't feel like you need an example
-tillto This will show you all the numbers from 1 to the parameter
Example: tillto(3) will show on 1 2 3
-fromto This will show all the number from the parameter to ∞
Example fromto(2) will show on screen 2 3 4 5 6 7 8 9...
WARNING!!!! This will never stop!!!
-fromtotillto will show all numbers from the first parameter to the second parameter
Example:fromtotillto(5,8) will show off on the screen 5 6 7 8
Also I insalled myself a BrandNew Source Code Formatter so you guys can see everything as it is !
-gsum will show on the screen the result of 1+2+3+4+...+parameter
Example:gsum(4) will show on the screen 10
-sum Makes the sum of the first parameter and the second
Example sum(5,7) will show on the screen 12
-subt Makes the subtraction between the first and the second parameter
Example: subtr(5,3) will show on the screen 2
-multpl It multiplies the first parameter with the second
Example mulptl(2,3) will show on the screen 6
-mod will show the modulo of the first parameter divided to the second
Example mod(3,2) will show on the screen 1
-divs It's the Not-So-Exact division and it return the first parameter divided at the second as an int variable;
Example:divs(4.3) will show on the screen 1
-exdiv it show the exact div between the first p and the second
Example:exdiv(4,3) will show on the screen 1,3333
-console_log Shows a message on the screen
Example console_log("Hello") will show on the screen Hello
-cmmdc It will find the biggest number wich divides both parameters!
Exmaple: cmmdc(2,4) will show on screen 2 because 2 is the biggest number which divides bots parameters! (2/2=1;4/2=2)
-cmmmc It will find the smallest common multiple of the 2 parameters.
Exmaple: cmmmc(5,7) will show on the screen 35 because is the smallest common multiple of 5 and 7;
-minimum Will shiw on the screen the smallest number from the 2 parameters
Exmaple: minimum(1,2) Will show on the screen 2 because 2>1
-maximum Will show on the screen the biggest number from the 2 parameters
Example:maximum(12,13) Will show on the screen 13 because 13>12;
-pow Is power
Example: pow(2,2) will show on the screen 4 because 22=4
-sqr Finds the square root of the parameter
Exmaple:sqr(4) will show on the screen 2 beacuse √(4)=2
Prefixes! This is now part of my library! There are at the moment 2 prefixes! With Return and With Cout
Also all the prefixes are limited by a bar (_) from the name of the function.
Examples:
WrNc_pcheck(5)
This is WIth Return(Wr) and No Cout(Nc)
Also because 5 is a prime number it will return 1 which means true!
NrWc_pcheck(5)
This is the default function!
Also if you dont understand prefixes you can still use the main function!
This means pcheck(5) will still work (pcheck(5) works the same as NrWc_pcheck(5))
-oppnum() It shows the opposite of the number
Example:oppnum(10) will show off -10!
Also i have fixed the div() function by renaming it divs()!
-isbigger() It returns 1 if the first parameter is bigger than the second else it returns 0.
Example: isbigger(5,3)=1
-issmaller() It returns 1 if the first parameter is smaller than the second else it returns 0.
Example: isbigger(3,5)=1
-isequal() It returns 1 if the first parameter is equal than the second else it returns 0.
Example: isequal(5,5)=1
For now that's all but stay tuned as more updates will come!