문제

i'm using BCmath to do math with 64 bit unsigned integers, i want to make a bcmath-object to a normal int (high, low part) how can i achieve that ?

Thank you for your help

도움이 되었습니까?

해결책

The inbuilt BCMath functions don't deal with BCMath objects as such, they just process on strings to achieve arbitrary precision computation. So you can convert back to a native php int with a normal cast.

$val = (int) bcmod( bcpow( "9392", "394" ), "100" );

From http://php.net/manual/en/book.bc.php, method signatures are

string bcmod ( string $left_operand , string $modulus )
string bcpow ( string $left_operand , string $right_operand [, int $scale ] )
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top