www.digitalmars.com

D Programming Language 1.0

Last update Mon Dec 31 10:53:28 2012

std.conv

Conversion building blocks. These differ from the C equivalents atoi() and atol() by checking for overflow and not allowing whitespace.

For conversion to signed types, the grammar recognized is:
Integer:
    Sign UnsignedInteger
    UnsignedInteger


Sign: + -
For conversion to signed types, the grammar recognized is:
UnsignedInteger:
    DecimalDigit
    DecimalDigit UnsignedInteger
 


Source:
std/conv.d

class ConvError: object.Error;
Thrown on conversion errors, which happens on deviation from the grammar.

class ConvOverflowError: object.Error;
Thrown on conversion overflow errors.

int toInt(char[] s);
uint toUint(char[] s);
long toLong(char[] s);
ulong toUlong(char[] s);
short toShort(char[] s);
ushort toUshort(char[] s);
byte toByte(char[] s);
ubyte toUbyte(char[] s);
float toFloat(char[] s);
double toDouble(char[] s);
real toReal(char[] s);
Convert character string to the return type.