On Thursday, 10 July 2014 at 17:30:17 UTC, Sean Campbell wrote:
if I need to Concatenate ints I'l just use a recursive pow
based on length
int ConcatInt(int[] anint){
int total = 0;
for(int i=0;i
With `foreach_reverse` it looks a little better:
```d
int concat_ints(int[] ints)
On Thursday, 10 July 2014 at 15:51:11 UTC, Olivier Pisano wrote:
Hello,
I may have not understood what you actually want to do, but
aren't std.bitmanip.peek or std.bitmanip.read what you are
looking for ?
http://dlang.org/phobos/std_bitmanip.html#.peek
std.bitmanip.peek and std.bitmanip.read
On Thursday, 10 July 2014 at 15:14:21 UTC, Sean Campbell wrote:
On Thursday, 10 July 2014 at 13:51:22 UTC, Rikki Cattermole
wrote:
On 11/07/2014 1:18 a.m., Sean Campbell wrote:
perhaps I'd better state what I'm doing.
i have an array of 4 bytes and a want to convert them to a 32
bit
int
and c
On Thursday, 10 July 2014 at 13:51:22 UTC, Rikki Cattermole wrote:
On 11/07/2014 1:18 a.m., Sean Campbell wrote:
perhaps I'd better state what I'm doing.
i have an array of 4 bytes and a want to convert them to a 32
bit
int
and convert the 32 bit int back into a 4 bytes again.
Small hack I u
Hello,
I may have not understood what you actually want to do, but
aren't std.bitmanip.peek or std.bitmanip.read what you are
looking for ?
http://dlang.org/phobos/std_bitmanip.html#.peek
On Thursday, 10 July 2014 at 13:51:22 UTC, Rikki Cattermole wrote:
On 11/07/2014 1:18 a.m., Sean Campbell wrote:
perhaps I'd better state what I'm doing.
i have an array of 4 bytes and a want to convert them to a 32
bit
int
and convert the 32 bit int back into a 4 bytes again.
Small hack I u
On 11/07/2014 1:18 a.m., Sean Campbell wrote:
perhaps I'd better state what I'm doing.
i have an array of 4 bytes and a want to convert them to a 32 bit
int
and convert the 32 bit int back into a 4 bytes again.
Small hack I use in Dakka:
union RawConvTypes(T) {
T value;
ubyte[T
perhaps I'd better state what I'm doing.
i have an array of 4 bytes and a want to convert them to a 32 bit
int
and convert the 32 bit int back into a 4 bytes again.
On 07/10/2014 02:22 PM, Rikki Cattermole wrote:
> On 11/07/2014 12:11 a.m., Sean Campbell wrote:
>> i have the ints 4, 7, 0 and 1 how can i Concatenate them into four
>> thousand seven hundred and one.
>
> If we talking at compile time definition:
>
> int myint = 4_7_0_1;
>
> Would work.
> Howev
Rikki Cattermole:
int myint = to!int("4" ~ "7" ~ "0" ~ "1");
And to concatenate them there is "join" (joiner is not yet usable
here, because to!() doesn't yet accept a lazy input,
unfortunately).
Now they are not strings, and the positions of 10^ doesn't
change then:
int myint = (1000
On 11/07/2014 12:11 a.m., Sean Campbell wrote:
i have the ints 4, 7, 0 and 1 how can i Concatenate them into four
thousand seven hundred and one.
If we talking at compile time definition:
int myint = 4_7_0_1;
Would work.
However I'll assume its at runtime you really want this.
I.e. convertin
i have the ints 4, 7, 0 and 1 how can i Concatenate them into
four thousand seven hundred and one.
12 matches
Mail list logo