Skip to content

printf() can strip sign of -INF #15964

Description

@divinity76

Description

The following code:

<?php
var_dump(sprintf("%.17g", -INF));

Resulted in this output:

string(3) "INF"

But I expected this output instead:

string(4) "-INF"

PHP Version

PHP 8.3.11

Operating System

Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions