Thanks. Do I need to use rational fractions for the Currencies
class?
On Saturday, 31 January 2015 at 15:02:09 UTC, Colin wrote:
Maybe you can articulate it in one post what this class is
trying to achieve?
Maybe this?
https://github.com/andersonpd/decimal/blob/master/decimal/bigfloat.d
The main thing is not to lose currency in calculations that use
arithmetic.
On Saturday, 31 January 2015 at 16:04:36 UTC, tcak wrote:
I do not have a big example in the end to show, but is there
any way to put labels into struct definitions?
struct CommunicationMessage{
char[2] signature;
mainData:
int info1;
int info2;
extraData:
ushort checksum;
You could use a UDA like that, though getting the offset will be
a bit tricky.
The idea is to use some uda type, even plain string is good
enough, then use the __traits to find the first appearance of
that UDA in the object and return that offset.
Keep in mind that the @uda: syntax applies
Oh this hack also won't work with a label at the very end. You
could use sizeof for that though (however that would include
padding bytes. Perhaps last member's offsetof plus last member's
sizeof is a bit more accurate.)
The next version, which does not work:
https://bpaste.net/show/b9c85de68d07
On 31.01.15 15:45, RuZzz wrote:
Maybe I need good examples on C++, for this class, because a lot of
examples on C++.
Maybe this can help you:
https://github.com/andersonpd/decimal
I want to understand the correct architecture of the class.
On Saturday, 31 January 2015 at 13:45:22 UTC, RuZzz wrote:
I want to understand the correct architecture of the class.
Sorry, you still did not state your problem (or what you are
trying to achieve) clearly.
Writing down a clear problem description is likely to get you
halfway to the
When trying to run my program with profiling enabled it dies
before the first line of my main function runs. Everything works
fine without profiling. I get the following stack trace:
thread #1: tid = 0x38de4, 0x00010008d985
vision_entry`gc_malloc + 49, queue = 'com.apple.main-thread',
On 31.01.15 15:56, zeljkog wrote:
On 31.01.15 15:45, RuZzz wrote:
Maybe I need good examples on C++, for this class, because a lot of
examples on C++.
Maybe this can help you:
https://github.com/andersonpd/decimal
Also
http://code.dlang.org/packages/eris
I do not have a big example in the end to show, but is there any
way to put labels into struct definitions?
struct CommunicationMessage{
char[2] signature;
mainData:
int info1;
int info2;
extraData:
ushort checksum;
content:
}
Example I defined something like above. I am
Maybe I need good examples on C++, for this class, because a lot
of examples on C++.
I am looking for not only free solutions.
On Saturday, 31 January 2015 at 14:26:45 UTC, RuZzz wrote:
The next version, which does not work:
https://bpaste.net/show/b9c85de68d07
I really dont understand what your trying to achieve here.
Maybe you can articulate it in one post what this class is trying
to achieve?
On 01/31/15 17:04, tcak via Digitalmars-d-learn wrote:
struct CommunicationMessage{
[...]
content:
}
Example I defined something like above. I am using it as a base structure,
and don't know how long the content of message will be. But I know that it
will be at the end. I could use
On 31.01.15 17:04, tcak wrote:
I do not have a big example in the end to show, but is there any way to
put labels into struct definitions?
struct CommunicationMessage{
char[2] signature;
mainData:
int info1;
int info2;
extraData:
ushort checksum;
content:
}
Members of
The next version
https://bpaste.net/show/9468f24d9df0
On Friday, 30 January 2015 at 14:41:11 UTC, Laeeth Isharc wrote:
Thanks, Adam. That's what I had thought (your first
paragraph), but something Ola on a different thread confused me
and made me think I didn't understand it, and I wanted to pin
it down.
There is always significant
how can i use wininet.dll from D? i got bindings from https://github.com/
CS-svnmirror/dsource-bindings-win32.git, and then i tried to create
wininet.lib with implib.exe from DMC package. no matter how i tried, the
resulting wininet.lib seems to not work, as linker keep complaining
about
How to get amount of digit after point in a double for to get
integer from a double?
assert(amountAfterPoint(1.456) == 3);
assert(amountAfterPoint(0.6) == 5);
without to!string
On Saturday, 31 January 2015 at 12:07:23 UTC, RuZzz wrote:
How to get amount of digit after point in a double for to get
integer from a double?
assert(amountAfterPoint(1.456) == 3);
assert(amountAfterPoint(0.6) == 5);
How about a loop like
import std.stdio;
void main(){
23 matches
Mail list logo