On 10/2/22 09:24, Fausto via Digitalmars-d-learn wrote:
Thanks a lot. I am to used to C and, more important, I didn't think to look for
also another operator for the power function :)
Oh, and I forgot to mention that this is doing what you probably asked for
originally:
```d
import std;
imp
On 10/2/22 09:24, Fausto via Digitalmars-d-learn wrote:
Thanks a lot. I am to used to C and, more important, I didn't think to look for
also another operator for the power function :)
D does have pow and many other useful math functions [1], it's just not defined
for BitInts. Oh, and speakin
On Sunday, 2 October 2022 at 02:02:37 UTC, rassoc wrote:
On 10/2/22 00:04, Fausto via Digitalmars-d-learn wrote:
Hello,
I am trying to use pow with an integer argument, but I cannot
have a bigint result, for example, ```pow(10,72)```.
Do I have to write my pow function or is there a native
so
On 10/2/22 00:04, Fausto via Digitalmars-d-learn wrote:
Hello,
I am trying to use pow with an integer argument, but I cannot have a bigint
result, for example, ```pow(10,72)```.
Do I have to write my pow function or is there a native solution?
thanks,
Fausto
In contrast to certain scripting
Hello,
I am trying to use pow with an integer argument, but I cannot
have a bigint result, for example, ```pow(10,72)```.
Do I have to write my pow function or is there a native solution?
thanks,
Fausto
On Tuesday, 24 March 2015 at 17:35:14 UTC, matovitch wrote:
xor it with -1 instead of 1. (-1 is store as 0xfff..f with the
classic modular arithmetic)
Thanks.
On Tuesday, 24 March 2015 at 17:28:50 UTC, Dennis Ritchie wrote:
On Tuesday, 24 March 2015 at 16:35:04 UTC, Ivan Kazmenko wrote:
What exactly is not working?
Everything works. I'm just a little forgotten properties of the
operation xor.
I just wanted to xor 1 each digit in the number of typ
On Tuesday, 24 March 2015 at 16:35:04 UTC, Ivan Kazmenko wrote:
What exactly is not working?
Everything works. I'm just a little forgotten properties of the
operation xor.
I just wanted to xor 1 each digit in the number of type BigInt,
while I would like to store each number in the binary
On Tuesday, 24 March 2015 at 15:45:36 UTC, Dennis Ritchie wrote:
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n = 18_446_724_073_70
On Tuesday, 24 March 2015 at 15:45:36 UTC, Dennis Ritchie wrote:
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n = 18_446_724_073_70
On Tuesday, 24 March 2015 at 15:45:36 UTC, Dennis Ritchie wrote:
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n = 18_446_724_073_70
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n = 18_446_724_073_709_551_614U;
bitArr[0] = format("%b", n).to!BigInt;
Great! Thanks a lot.
Kind regards
André
On Friday, 19 December 2014 at 08:47:50 UTC, bearophile wrote:
Andre:
Do you have any idea how to translate the coding correctly?
Try:
i += long(buffer[3]) << 24 >>> 0;
But I also suggest to add parentheses, to make the code less
unreadable for hum
Andre:
Do you have any idea how to translate the coding correctly?
Try:
i += long(buffer[3]) << 24 >>> 0;
But I also suggest to add parentheses, to make the code less
unreadable for humans.
Bye,
bearophile
Hi,
I try to translate following javascript coding to D:
i = buffer[2] << 16;
i |= buffer[1] << 8;
i |= buffer[0];
i += buffer[3] << 24 >>> 0;
Buffer is:
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 111]
Expected result for i is: 4294967295
But in D the last st
On Thu, Dec 20, 2012 at 07:46:39PM +0100, Joseph Rushton Wakeling wrote:
> Hello all,
>
> I've been playing around trying to implement the Cantor tuple function
> (see attached code), which is essentially a way to map a sequence x1,
> x2, ..., xN of non-negative integers to a single unique number.
Hello all,
I've been playing around trying to implement the Cantor tuple function (see
attached code), which is essentially a way to map a sequence x1, x2, ..., xN of
non-negative integers to a single unique number. See:
https://en.wikipedia.org/wiki/Pairing_function#Cantor_pairing_function
17 matches
Mail list logo