Converting an integer to a string with std.format.

Stefan Koch uplink.coder at googlemail.com
Mon Jan 7 12:17:37 UTC 2019


On Sunday, 6 January 2019 at 21:53:31 UTC, Per Nordlöw wrote:
> When converting a single integer to a string is `formatValue` 
> preferred over `formattedWrite` in terms of compilation and 
> run-time performance?

I've written my own itos function because using std.conv was too 
expensive.
see 
https://github.com/UplinkCoder/dmd/blob/newCTFE_reboot_20741/src/ctfe/bc_common.d#L95

if you do want to convert longs you'll need a bigger pow_table as 
well as a diffrent log10 function.


More information about the Digitalmars-d-learn mailing list