This javascript is used to find the prime factors of a given number and also to find the factors of given number.
Features
a) Used to find the prime factors of the given number.
b) This calculator provides factorization even for large numbers.
c) Provides easy accessibility to calculation.
Preview
Prime Factor Calculator
Code
Javascript Code
<!-- Script by hscripts.com -->
<!-- Copyright of HIOXINDIA -->
<!-- More scripts @www.hscripts.com -->
<script type="text/javascript">
function factorise(numm)
{
var newnum = numm;
var newtext = "";
var chk = 2;
while (chk*chk <= newnum){
if (newnum % chk == 0){
newtext = newtext + chk;
newnum = newnum/chk;
if (newnum != 1){
newtext = newtext + "*";
}
}
else{
chk++;
}
}
if (newnum != 1){
newtext = newtext + newnum;
}
if (newtext == "" + numm){
newtext = "Prime Number:"+newtext;
}
document.frm.result.value=newtext;
}
</script>
<!-- Script by hscripts.com -->
For customization of this script or any script development, contact us at support@hscripts.com
Usage
a) Copy and paste the javascript code into your HTML page and make use of this calculator.
b) Here,the function "factorise()" provides the prime factorization of the given number.
c) This script calculates dynamically the factors of any given number.
License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.