Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1711 (assigned defect)

Opened 15 years ago

Last modified 14 years ago

string to integer converters provide no way to check for overflow

Reported by: lindquist Assigned to: kris (accepted)
Priority: major Milestone: 1.0
Component: Tango Version: 0.99.8 Sean
Keywords: Cc: lindquist, larsivi

Description

As demonstrated by this small example:

import Integer = tango.text.convert.Integer;
import tango.io.Stdout;

void main()
{
    char[] str = "123456789012345678901234567890";
    uint ate;
    ulong ul = Integer.convert(str, 10, &ate);
    assert(ate == str.length);
    Stdout.formatln("{} = {}", str, ul);
}

/*
Output:
123456789012345678901234567890 = 14083847773837265618
*/

Change History

11/09/09 09:37:59 changed by kris

  • status changed from new to assigned.

What do you suggest, lindquist? Is there a patch available? :)

11/14/09 07:44:19 changed by kris

  • cc set to lindquist, larsivi.
  • milestone changed from 0.99.9 to 1.0.