
Rewrite small JavaScript code into PHP
- or -
Post a project like this3612
$
- Posted:
- Proposals: 3
- Remote
- #1041039
- Awarded
Description
Experience Level: Entry
General information for the website: maths
Description of requirements/features: Rewrite small JavaScript code into PHP
Extra notes: The current code is as follows:
0) {
z /= Math.pow( 10, dec );
if (s z) s += 0.5 * z;
else
s = 0;
}
// assure a string
s = "" + s;
// chop neg, if any
var neg = 0;
if (s.charAt(0) == "-") {
neg = 2;
s = s.substring( 1, s.length );
}
// chop exponent, if any
var exp = "";
var e = s.lastIndexOf( "E" );
if (e 0) && ((s.length - dp - 1) 0)
s = "-" + s;
// if not enough width, add spaces IN FRONT
// too many places? tough!
while (s.length < wid)
s = " " + s;
return s
}
function Prb( x ) {
if (x 1) x = 1;
return x;
}
function PosV( x ) {
if (x 1)
t *= x--;
return t;
}
function LnFact( x ) {
// ln(x!) by Stirling's formula
// see Knuth I: 111
if (x <= 1) x = 1;
if (x = 20) return PoissonPD( u, k );
else {
var sum = 0.0, j = 0;
while (j
Description of requirements/features: Rewrite small JavaScript code into PHP
Extra notes: The current code is as follows:
0) {
z /= Math.pow( 10, dec );
if (s z) s += 0.5 * z;
else
s = 0;
}
// assure a string
s = "" + s;
// chop neg, if any
var neg = 0;
if (s.charAt(0) == "-") {
neg = 2;
s = s.substring( 1, s.length );
}
// chop exponent, if any
var exp = "";
var e = s.lastIndexOf( "E" );
if (e 0) && ((s.length - dp - 1) 0)
s = "-" + s;
// if not enough width, add spaces IN FRONT
// too many places? tough!
while (s.length < wid)
s = " " + s;
return s
}
function Prb( x ) {
if (x 1) x = 1;
return x;
}
function PosV( x ) {
if (x 1)
t *= x--;
return t;
}
function LnFact( x ) {
// ln(x!) by Stirling's formula
// see Knuth I: 111
if (x <= 1) x = 1;
if (x = 20) return PoissonPD( u, k );
else {
var sum = 0.0, j = 0;
while (j
Jarratt P.
100% (8)Projects Completed
9
Freelancers worked with
9
Projects awarded
59%
Last project
7 Sep 2019
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies