Is there a more accurate way to do a float and or double to
string than...
to!string(float);
As that seems to limit itself to 6 digits.
On Tuesday, 24 February 2015 at 20:08:55 UTC, Justin Whear wrote:
On Tue, 24 Feb 2015 20:04:04 +, Almighty Bob wrote:
Is there a more accurate way to do a float and or double to
string
than...
to!string(float);
As that seems to limit itself to 6 digits.
Use std.string.format or
On Tue, Feb 24, 2015 at 08:04:04PM +, Almighty Bob via Digitalmars-d-learn
wrote:
Is there a more accurate way to do a float and or double to string
than...
to!string(float);
As that seems to limit itself to 6 digits.
What about std.format.format(%.12f, myFloat)?
Or, if you like:
On Tue, 24 Feb 2015 20:04:04 +, Almighty Bob wrote:
Is there a more accurate way to do a float and or double to string
than...
to!string(float);
As that seems to limit itself to 6 digits.
Use std.string.format or std.format.formattedWrite. std.format contains
a description of the
Just to clarify what i needed was...
%.8g or %.7e
Significant digits, or fixed width scientific form. I needed more
significant digits.
%.8f controls how many digits to print after the decimal point,
which is not the same thing.
There is a int[] ,how to use the Fiber execute it ?
Such as :
import std.stdio;
import core.thread;
class DerivedFiber : Fiber
{
this()
{
super( run );
}
private :
void run()
{
printf( Derived fiber running.\n );
faa();
}
}
int[] v;
void
On Tuesday, February 24, 2015 08:49:55 Jacob Carlborg via Digitalmars-d-learn
wrote:
Is the deprecation process used for Phobos and druntime code documented
somewhere? I.e. how long after a deprecation is a symbols removed and so on.
No, it's not documented. I really should put it up on the
On Tuesday, 24 February 2015 at 12:16:43 UTC, Tobias Pankrath
wrote:
On Tuesday, 24 February 2015 at 12:05:51 UTC, amber wrote:
Hi,
Is it possible in D to have inheritance using value types,
i.e. structs?
No runtime polymorphism, but a kind of sub typing via alias
this.
struct S { void
On Tuesday, 24 February 2015 at 06:48:26 UTC, ketmar wrote:
but why do you need this? just use `atomicLoad` to get shared
variable
value, it will do the right caching.
Nice! Thanks. Tested atomicLoad and it is slightly faster for my
non blocking queue.
On Tuesday, 24 February 2015 at 12:05:51 UTC, amber wrote:
Hi,
Is it possible in D to have inheritance using value types, i.e.
structs?
No runtime polymorphism, but a kind of sub typing via alias this.
struct S { void foo() { writeln(S.foo); }
struct T { S s; alias s this; }
T t;
t.foo();
Hi,
Is it possible in D to have inheritance using value types, i.e.
structs?
Also I don't quite understand how copy ctors work in D. Do I need
to implement opAssign(S other) {}, or this(this) {} and what's
the difference between these two?
Thanks,
Amber
On Tuesday, 24 February 2015 at 07:49:55 UTC, Jacob Carlborg
wrote:
Can you help me about 'Concurrency in D'? Thank you.
http://forum.dlang.org/thread/dugsyhsswoovgywpl...@forum.dlang.org
Some people think rust is better ,but I think D is better.
But I don't know that how to use 'Concurrency
On 2015-02-24 10:20, Jonathan M Davis via Digitalmars-d-learn wrote:
No, it's not documented. I really should put it up on the wiki. The current
process is that if the replacement for the symbol is being introduced at the
same time, the old symbol will be marked as deprecated for a release (so
On Tuesday, February 24, 2015 17:57:12 Jacob Carlborg via Digitalmars-d-learn
wrote:
On 2015-02-24 10:20, Jonathan M Davis via Digitalmars-d-learn wrote:
No, it's not documented. I really should put it up on the wiki. The current
process is that if the replacement for the symbol is being
On Tue, 24 Feb 2015 12:05:50 +, amber wrote:
Hi,
Is it possible in D to have inheritance using value types, i.e. structs?
Also I don't quite understand how copy ctors work in D. Do I need to
implement opAssign(S other) {}, or this(this) {} and what's the
difference between these two?
On Tue, 24 Feb 2015 18:19:39 +, ketmar wrote:
On Tue, 24 Feb 2015 12:05:50 +, amber wrote:
Hi,
Is it possible in D to have inheritance using value types, i.e.
structs?
Also I don't quite understand how copy ctors work in D. Do I need to
implement opAssign(S other) {}, or
On Tue, 24 Feb 2015 12:05:50 +, amber wrote:
Hi,
Is it possible in D to have inheritance using value types, i.e. structs?
Also I don't quite understand how copy ctors work in D. Do I need to
implement opAssign(S other) {}, or this(this) {} and what's the
difference between these two?
On Tue, 24 Feb 2015 12:50:53 +, Rory wrote:
On Tuesday, 24 February 2015 at 06:48:26 UTC, ketmar wrote:
but why do you need this? just use `atomicLoad` to get shared variable
value, it will do the right caching.
Nice! Thanks. Tested atomicLoad and it is slightly faster for my non
On Tue, Feb 24, 2015 at 09:55:28AM -0800, Jonathan M Davis via
Digitalmars-d-learn wrote:
[...]
Regardless, when a symbol is either marked as scheduled for
deprecation in the docs or outright deprecated, a date is usually put
in the docs for when it will be moved to the next deprecation stage,
On Tue, Feb 24, 2015 at 06:22:05PM +, ketmar via Digitalmars-d-learn wrote:
On Tue, 24 Feb 2015 12:05:50 +, amber wrote:
Hi,
Is it possible in D to have inheritance using value types, i.e.
structs?
Also I don't quite understand how copy ctors work in D. Do I need to
On Tuesday, 24 February 2015 at 22:37:58 UTC, Ola Fosheim Grøstad
wrote:
1. My understanding is that @trusted is supposed to give memory
safety escapes by providing a context which reestablish a
memory safety context on return.
Yep, that's how I got it, too. A @trusted function is supposed to
On 02/24/2015 02:51 PM, Tobias Pankrath wrote:
On Tuesday, 24 February 2015 at 22:12:57 UTC, Freddy wrote:
Why are strings immutable but array literals are not?
Because string is an alias for immutable(char).
You meant immutable(char)[]. :)
Ali
On Tuesday, 24 February 2015 at 22:49:17 UTC, w0rp wrote:
In general, @trusted means I have proven myself that this code
is actually safe, eeven though it uses unsafe features. The
compiler has to be pessimistic and assume that everything which
can be used unsafely will be used unsafely.
On Wednesday, 25 February 2015 at 00:12:41 UTC, anonymous wrote:
If the whole function was @trusted, the compiler wouldn't catch
other safety violations that are not related to malloc/free.
You don't need to. In C++ you use a separate @trusted
data-structure for capturing ownership, aka
Hello,everyone,what is a better way with concurrency?
http://forum.dlang.org/thread/urqxiaairpnrjggqd...@forum.dlang.org
Thank you.
Why are strings immutable but array literals are not?
Since neither Andrei or Walter are able to say something sensible
on these issues when asked, I apparently need to learn something
about the consistency of C memory safety.
I'm happy to listen to anyone who can explain this to me:
1. My understanding is that @trusted is supposed to give
On Tuesday, 24 February 2015 at 22:37:58 UTC, Ola Fosheim Grøstad
wrote:
If this is careful use of @trusted, then I don't see the point
of having @trusted at all. What is the purpose? What is it
meant to cover? In order for @trusted to make sense in this
code segment (
On Tuesday, February 24, 2015 10:05:21 H. S. Teoh via Digitalmars-d-learn wrote:
On Tue, Feb 24, 2015 at 09:55:28AM -0800, Jonathan M Davis via
Digitalmars-d-learn wrote:
[...]
Regardless, when a symbol is either marked as scheduled for
deprecation in the docs or outright deprecated, a
On Tuesday, 24 February 2015 at 22:12:57 UTC, Freddy wrote:
Why are strings immutable but array literals are not?
Because string is an alias for immutable(char).
30 matches
Mail list logo