I found some codes write
toStringz(myString)
as
mystring.toStringz
So I tested this code myself and it worked.
int pow2(int i)
{
return i*i;
}
int myint = 5;
int otherint = myint.pow2;
assert(otherint == 25);
I've never seen any documentation about this behaviour. I think
it's a good
import std.math;
import std.mathspecial;
import std.stdio;
void main(string[] args)
{
writeln(erf(0.5));
}
I was writing on my phone, so I couldn't add some code. And, my pc browser
won't load digitalmars.D html page, either, so I post this again here. It was
okay before... maybe server
It seems here isn't write place for posting this, but my phone always fail to
load digitalmars.D html page.
(I cannot use my computer right now.)
I was making a simple program and I had to use erfc() function, which is in
std.mathspecial. I needed some
functions in std.math. After importing it,
I think I found a solution for it. This code changes encoding of string to
ansi which is default string encoding in windows console.
import std.c.windows.windows;
string ansi(string str)
{
wchar[] src = toUTF16(str).dup;
char[] dest;
dest.length = str.length;
Thank you. It worked!
Does anyone knows how can I set the boundary of uniform()?
I got an error with uniform([], 0, 10);
Thank you for the answer, Vladimir, but it didn't work. The code page of my
console was 949 which supports Korean characters. I tested with french and e
with ` (I don't know its name)was not printed properly. Both wstring dstring
resulted the same problem.
I'm sorry for posting in the wrong place.
I attached screenshot of my code and the result.
As you can see, Korean letters get changed after compilation.
This problem doesn't happen with user input(from readln() method).
Should I use different type and prefix or suffix similary to C++?
begin