Re: Accurately serializing and deserializing a SysTime in binary format

2020-07-21 Thread Ecstatic Coder via Digitalmars-d-learn
On Tuesday, 21 July 2020 at 12:21:16 UTC, Steven Schveighoffer wrote: On 7/21/20 7:44 AM, Ecstatic Coder wrote: On Tuesday, 21 July 2020 at 11:01:20 UTC, drug wrote: On 7/20/20 10:04 PM, Ecstatic Coder wrote: I'm currently implementing a small open source backup tool (dub), and therefore I

Re: Accurately serializing and deserializing a SysTime in binary format

2020-07-21 Thread Ecstatic Coder via Digitalmars-d-learn
On Tuesday, 21 July 2020 at 11:01:20 UTC, drug wrote: On 7/20/20 10:04 PM, Ecstatic Coder wrote: I'm currently implementing a small open source backup tool (dub), and therefore I need to accurately store the file modification SysTime in binary format, so that I can later load this SysTime

Re: Accurately serializing and deserializing a SysTime in binary format

2020-07-21 Thread Ecstatic Coder via Digitalmars-d-learn
As my question obviously didn't interest any expert, I took advantage of my lunch break to do some more research ;) Maybe I'm wrong, but to my knowledge, there is no function to get the number of hectonanoseconds since January 1, 1970. Fortunately I can get the number of seconds since the

Accurately serializing and deserializing a SysTime in binary format

2020-07-20 Thread Ecstatic Coder via Digitalmars-d-learn
I'm currently implementing a small open source backup tool (dub), and therefore I need to accurately store the file modification SysTime in binary format, so that I can later load this SysTime from the snapshot file to compare it with the current file modification SysTime. Having

Re: Full precision double to string conversion

2018-11-03 Thread Ecstatic Coder via Digitalmars-d-learn
On Saturday, 3 November 2018 at 18:04:07 UTC, Stanislav Blinov wrote: On Saturday, 3 November 2018 at 17:26:19 UTC, Ecstatic Coder wrote: void main() { double value = -12.000123456; int precision = 50; import std.stdio; writefln("%.*g", precision, value); import

Re: Full precision double to string conversion

2018-11-03 Thread Ecstatic Coder via Digitalmars-d-learn
Actually, what I need is the D equivalent of the default ToString() function we have in Dart and C#. I don't think it means what you think it means: void main() { double value = -12.000123456; int precision = 50; import std.stdio; writefln("%.*g", precision, value);

Re: Full precision double to string conversion

2018-11-03 Thread Ecstatic Coder via Digitalmars-d-learn
On Saturday, 3 November 2018 at 12:45:03 UTC, Danny Arends wrote: On Saturday, 3 November 2018 at 12:27:19 UTC, Ecstatic Coder wrote: import std.conv; import std.stdio; void main() { double value = -12.000123456; writeln( value.sizeof ); writeln( value ); writeln(

Full precision double to string conversion

2018-11-03 Thread Ecstatic Coder via Digitalmars-d-learn
import std.conv; import std.stdio; void main() { double value = -12.000123456; writeln( value.sizeof ); writeln( value ); writeln( value.to!string() ); writeln( value.to!dstring() ); } /* 8 -12.0001 -12.0001 -12.0001 */ In Dart, value.toString() returns "-12.000123456". In

Re: Is there a pragma or command line option to ask DMD to show a warning when it implicitly casts from long to ulong ?

2017-12-15 Thread Ecstatic Coder via Digitalmars-d-learn
On Friday, 15 December 2017 at 21:55:12 UTC, Michael wrote: On Friday, 15 December 2017 at 21:29:10 UTC, Jonathan M Davis wrote: On Friday, December 15, 2017 20:40:10 Ecstatic Coder via Digitalmars-d-learn wrote: It's taken me some time to find an implicit cast bug

Is there a pragma or command line option to ask DMD to show a warning when it implicitly casts from long to ulong ?

2017-12-15 Thread Ecstatic Coder via Digitalmars-d-learn
It's taken me some time to find an implicit cast bug ("if (my_sometimes_negative_index >= this_array.length)"), while a simple C++-like implicit-cast warning would have allowed me to find this nasty bug WAY sooner...

Re: Panda Antivirus puts the latest dmd installer in quarantine

2017-07-06 Thread Ecstatic Coder via Digitalmars-d-learn
Why is it put in quarantine? Posting the reason and some information about it would help a lot to identify the issue. If I remember well, it has detected a "W32/exploit.gen". The file was put in quarantine in the second I tried to execute the installer. Here is the current VirusTotal

Panda Antivirus puts the latest dmd installer in quarantine

2017-07-06 Thread Ecstatic Coder via Digitalmars-d-learn
But no problem with any file stored inside the current .7z archive file. So I guess the problem comes from the installer executable itself. Please try to fix this as soon as possible, as this immediately drives people away from D before they even got a chance to install it...