Skip to content

Rounding in parser doesn't work/is not used #244

@Flamefire

Description

@Flamefire

The code to check for rounding isn't tested:

if (offset > significand_buffer_size)
{
offset = significand_buffer_size - 1;
i = significand_buffer_size;
if (significand_buffer[offset] == '5' ||
significand_buffer[offset] == '6' ||
significand_buffer[offset] == '7' ||
significand_buffer[offset] == '8' ||
significand_buffer[offset] == '9')
{
round = true;
}
}

I guess the initial idea was:

This IMO needs an additional overflow check in the rounding (the +=1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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