Doc Comments / Phobos /
Std Conv
Difference (previous author) (Change, Edit, normal page display)
Changed: 1c1
=std.conv= |
=std.conv= |
Changed: 4c4
== More Information = |
== Comments = |
Changed: 17c17
Source: Posting:digitalmars.D/12382 |
Source: NG:digitalmars.D/12382 |
Changed: 20c20
(Jan 2006: Those functions are currently included in std.conv, and have DDoc comments, but are not documented in Phobos). |
=== D 1.x/2.x Differences === |
Added: 21a22
Some templates (e.g. to, roundTo, parse) have been added to the D 2.x version. The std2 project contains a port for D 1.x. |
Changed: 26c27,29
See the corresponding page in the D Specification: DigitalMars:d/phobos/std_conv.html |
* Corresponding page in the D Specification: ** D 1.x ** D 2.x |
std.conv
Comments
Add your comments here...
Extending std.conv with floating-point wrapper functions
I was looking into the std.conv module the other evening, and I had thought it had conversion functions for all of the D numerical types, but sadly I discovered that it only did the whole-number types. So the next evening I looked around and found std.string.atof() that does only float and double, and std.math2's "real atof( in char[] )" function, which does a pretty good job with float, double, and real right out of the box. With a bit of playing around with std.math2 yet the next evening I managed to make some useful wrapper functions that worked well with D's remaining floating-point types: ifloat, idouble, ireal, cfloat, cdouble, and creal.
I really think it would be great if Walter would add these functions, or functions like these to the std.conv before D v1.0. It would make std.conv more complete, and on top of that, it would save a person's time looking all around for functions to convert number-types that were converted with std.string.toString() functions back to their original D's numerical value(s).
...
Source: NG:digitalmars.D/12382
D 1.x/2.x Differences
Some templates (e.g. to, roundTo, parse) have been added to the D 2.x version. The std2 project contains a port for D 1.x.
Links