PHP's bcmath in bmax?

BlitzMax Forums/BlitzMax Programming/PHP's bcmath in bmax?

You need to convert the rather large hex number into a looooooong integer representation - just like what AOChat does...

eg.
...
	function bcmath_powm($base, $exp, $mod)
	{
		$base = $this->bighexdec($base);
		$exp  = $this->bighexdec($exp);
		$mod  = $this->bighexdec($mod);
...

and
	function bighexdec($x)
	{
		if(substr($x, 0, 2) != "0x")
		{
			return $x;
		}
		$r = "0";
		for($p = $q = strlen($x) - 1; $p >= 2; $p--)
		{
			$r = bcadd($r, bcmul(hexdec($x[$p]), bcpow(16, $q - $p)));
		}
		return $r;
	}


The rest should be easy to port..

;-)