Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for Convert JavaScript function to PHP

Current License: CC BY-SA 4.0

18 events
when toggle format what by license comment
S Dec 9, 2021 at 9:03 history bounty ended Community Bot
S Dec 9, 2021 at 9:03 history notice removed Community Bot
Dec 6, 2021 at 13:08 comment added szmegma @hanshenrik This is a little part of the whole file. bs=28 (global value) and the zeros function is creating an array with zeros. nmt = 3; q=zeros(nmt+1); creating this => q=[ 0, 0, 0, 0 ]
Dec 5, 2021 at 22:58 comment added hanshenrik also references a function that doesn't exist, what is the function zeros supposed to do?
Dec 5, 2021 at 22:39 comment added hanshenrik your javascript function isn't runnable, on line 21 it references a bs variable which doesn't exist. what is bs supposed to be on line 21's shift=bs-shift2 ?
Dec 3, 2021 at 14:33 history edited szmegma CC BY-SA 4.0
added 616 characters in body
Dec 2, 2021 at 18:18 history edited szmegma CC BY-SA 4.0
I apply Kiran Shakya solution in the code, but there is a new behaviour appeared when the PHP operated with arbitrary precision numbers in the toppart() function.
Dec 2, 2021 at 13:00 answer added Booboo timeline score: 4
Dec 2, 2021 at 6:27 answer added Kiran Shakya timeline score: 3
Dec 2, 2021 at 6:07 answer added Jyotikant Patil timeline score: 1
Dec 1, 2021 at 20:56 answer added user6302504 timeline score: 1
Dec 1, 2021 at 7:28 comment added ikhvjs x=x.concat() in js means to clone a new array from x and return it to x. The reason to do it is not mutate the original input. In php, you may use array_slice($x, 0) to return a new array from it instead of array_push($x,$x);
S Dec 1, 2021 at 7:15 history bounty started szmegma
S Dec 1, 2021 at 7:15 history notice added szmegma Draw attention
Nov 25, 2021 at 23:58 comment added szmegma @AKX Exactly this is my version! Unfortunately, I'm not familiar with this function and as I read a bit, the inputs are strings, not arrays.
Nov 25, 2021 at 21:20 review Close votes
Nov 29, 2021 at 0:00
Nov 25, 2021 at 21:03 comment added AKX Googling the code, it looks like it's an arbitrary-precision division function. If that's the case, why don't you just use bcmath's bcdiv()?
Nov 25, 2021 at 20:59 history asked szmegma CC BY-SA 4.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /