Skip to content

Overflow in pow() #16502

Open
Open
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
$a = gmp_init(10000000000);
var_dump(pow($a, $a)); // or var_dump($a**$a);

Resulted in this output:

gmp: overflow in mpz type
Aborted (core dumped)

But I expected this output instead:

float(INF)

PHP Version

nightly

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions