Hi all,
from the previous discussion with Richard I came up with a new idea to
create a random number. I call the Go program lun = Lucky Number.
Here is a sample run with 3 seconds set. You can also use1 or many more seconds.
$ lun 3
Started: 2025-03-08 01:29:57
2287128966796887 1741393797 2287130708190684
2443764953918824 1741393798 2443766695312622
8241182675020522 1741393799 8241184416414321
Ended: 2025-03-08 01:29:59
Time elapsed: 00:00:03
Multiplying: 2287130708190684 * 8241184416414321
Your lucky number is: 18848665950643714819328816385564
SHA256: 28fd1445771c772f403eb4092b722640a529b5c84c3ee50bc6d631454e83daed
The first column is a random number, the second the local Unix-Epoch-Time
and the third shows the addition of column1 and column2. The lucky number
was generated by multiplying the first and last value of the right column.
Hope you like the idea!
Stefan Claas wrote:
Hi all,
from the previous discussion with Richard I came up with a new idea to create a random number. I call the Go program lun = Lucky Number.
Here is a sample run with 3 seconds set. You can also use1 or many more seconds.
$ lun 3
Started: 2025-03-08 01:29:57
2287128966796887 1741393797 2287130708190684
2443764953918824 1741393798 2443766695312622
8241182675020522 1741393799 8241184416414321
Ended: 2025-03-08 01:29:59
Time elapsed: 00:00:03
Multiplying: 2287130708190684 * 8241184416414321
Your lucky number is: 18848665950643714819328816385564
SHA256: 28fd1445771c772f403eb4092b722640a529b5c84c3ee50bc6d631454e83daed
The first column is a random number, the second the local Unix-Epoch-Time and the third shows the addition of column1 and column2. The lucky number was generated by multiplying the first and last value of the right column.
Hope you like the idea!
Forgot the URL: https://github.com/706f6c6c7578/lun
Hi all,
from the previous discussion with Richard I came up with a new idea to
create a random number. I call the Go program lun = Lucky Number.
Here is a sample run with 3 seconds set. You can also use1 or many
more seconds.
$ lun 3
Started: 2025-03-08 01:29:57
2287128966796887 1741393797 2287130708190684
2443764953918824 1741393798 2443766695312622
8241182675020522 1741393799 8241184416414321
Ended: 2025-03-08 01:29:59
Time elapsed: 00:00:03
Multiplying: 2287130708190684 * 8241184416414321
Your lucky number is: 18848665950643714819328816385564
SHA256: 28fd1445771c772f403eb4092b722640a529b5c84c3ee50bc6d631454e83daed
The first column is a random number
, the second the local Unix-Epoch-Time
and the third shows the addition of column1 and column2.
The lucky number was generated by multiplying the first and last
value of the right column.
Hope you like the idea!
Stefan Claas <fgrsna.pynnf@vagrearg.eh> wrote:
Hi all,
from the previous discussion with Richard I came up with a new idea to create a random number. I call the Go program lun = Lucky Number.
How /random/ do you want this number to be?
Here is a sample run with 3 seconds set. You can also use1 or many
more seconds.
$ lun 3
Started: 2025-03-08 01:29:57
2287128966796887 1741393797 2287130708190684
2443764953918824 1741393798 2443766695312622
8241182675020522 1741393799 8241184416414321
Ended: 2025-03-08 01:29:59
Time elapsed: 00:00:03
Multiplying: 2287130708190684 * 8241184416414321
Your lucky number is: 18848665950643714819328816385564
SHA256: 28fd1445771c772f403eb4092b722640a529b5c84c3ee50bc6d631454e83daed
The first column is a random number
So, you already have a *random number*. Why do any more?
, the second the local Unix-Epoch-Time
Very *not* random.
and the third shows the addition of column1 and column2.
Provided the random number was "good enough randomness" this has no
benefit.
The lucky number was generated by multiplying the first and last
value of the right column.
The product R1 * R2 is little different, randomness wise, from the
product R1 * (R2 + Predictable_Offset). If you can generate random
numbers, what is the value in computing R1 * (R2 + Predictable_Offset)?
Hope you like the idea!
I fail to see any point to it.
If you can generate a random number, then you already have a random
number. You can stop here and enjoy using your random number.
Rich wrote:
Stefan Claas <fgrsna.pynnf@vagrearg.eh> wrote:
Hi all,
from the previous discussion with Richard I came up with a new idea to create a random number. I call the Go program lun = Lucky Number.
How /random/ do you want this number to be?
Here is a sample run with 3 seconds set. You can also use1 or many
more seconds.
$ lun 3
Started: 2025-03-08 01:29:57
2287128966796887 1741393797 2287130708190684
2443764953918824 1741393798 2443766695312622
8241182675020522 1741393799 8241184416414321
Ended: 2025-03-08 01:29:59
Time elapsed: 00:00:03
Multiplying: 2287130708190684 * 8241184416414321
Your lucky number is: 18848665950643714819328816385564
SHA256: 28fd1445771c772f403eb4092b722640a529b5c84c3ee50bc6d631454e83daed
The first column is a random number
So, you already have a *random number*. Why do any more?
, the second the local Unix-Epoch-Time
Very *not* random.
and the third shows the addition of column1 and column2.
Provided the random number was "good enough randomness" this has no benefit.
The lucky number was generated by multiplying the first and last
value of the right column.
The product R1 * R2 is little different, randomness wise, from the
product R1 * (R2 + Predictable_Offset). If you can generate random numbers, what is the value in computing R1 * (R2 + Predictable_Offset)?
Hope you like the idea!
I fail to see any point to it.
If you can generate a random number, then you already have a random
number. You can stop here and enjoy using your random number.
Why do you always have something to "complain" about? Enjoy the software,
it is cool and not so boring like using /dev/urandom. Or better instead
of "complaining" do something creative, crypto wise and show it to us too.
Stefan Claas <fgrsna.pynnf@vagrearg.eh> wrote:
Hi all,
from the previous discussion with Richard I came up with a new idea to
create a random number. I call the Go program lun = Lucky Number.
How /random/ do you want this number to be?
Here is a sample run with 3 seconds set. You can also use1 or many
more seconds.
$ lun 3
Started: 2025-03-08 01:29:57
2287128966796887 1741393797 2287130708190684
2443764953918824 1741393798 2443766695312622
8241182675020522 1741393799 8241184416414321
Ended: 2025-03-08 01:29:59
Time elapsed: 00:00:03
Multiplying: 2287130708190684 * 8241184416414321
Your lucky number is: 18848665950643714819328816385564
SHA256: 28fd1445771c772f403eb4092b722640a529b5c84c3ee50bc6d631454e83daed
The first column is a random number
So, you already have a *random number*. Why do any more?
, the second the local Unix-Epoch-Time
Very *not* random.
and the third shows the addition of column1 and column2.
Provided the random number was "good enough randomness" this has no
benefit.
The lucky number was generated by multiplying the first and last
value of the right column.
The product R1 * R2 is little different, randomness wise, from the
product R1 * (R2 + Predictable_Offset). If you can generate random
numbers, what is the value in computing R1 * (R2 + Predictable_Offset)?
Hope you like the idea!
I fail to see any point to it.
If you can generate a random number, then you already have a random
number. You can stop here and enjoy using your random number.
Rich wrote:
I fail to see any point to it.
If you can generate a random number, then you already have a random
number. You can stop here and enjoy using your random number.
Why do you always have something to "complain" about? Enjoy the software,
it is cool and not so boring like using /dev/urandom.
Or better instead
of "complaining" do something creative, crypto wise and show it to us too.
Not to mention that you can do lun with a pencil and paper to get good entropy
On 08/03/2025 18:50, Stefan Claas wrote:
<snip>
Not to mention that you can do lun with a pencil and paper to get good entropy
Or you can roll dice. I have 20d16 for that specific purpose.
On 08/03/2025 18:38, Stefan Claas wrote:
Rich wrote:
<snip>
I fail to see any point to it.
If you can generate a random number, then you already have a random number. You can stop here and enjoy using your random number.
Why do you always have something to "complain" about? Enjoy the software, it is cool and not so boring like using /dev/urandom.
It's a NOP. What's so cool about a NOP?
Or better instead
of "complaining" do something creative, crypto wise and show it to us too.
Turning a random number into a random number isn't creative.
Not to mention that you can do lun with a pencil and paper to get
good entropy (where humans fail) for a password, because it is simple
and easy to understand.
Why do you always have something to "complain" about?
Enjoy the software, it is cool
and not so boring like using dev/urandom.
Or better instead of "complaining" do something creative, crypto wise
and show it to us too.
Looking at the source, how does someone with pencil and paper perform
this magic?:
n, _ := rand.Int(rand.Reader, max)
As well, with just pencil and paper, obtaining a Unix epoch is quite an interesting 'by hand' calculation in order to perform this:
epochTime := time.Now().Unix()
Ok, here's a simple random number generator using /dev/urandom:
#!/usr/bin/tclsh
set fd [open /dev/urandom {RDONLY BINARY}]
binary scan [read $fd 16] ww hi lo
close $fd
puts "Your 128-bit random number is: [expr {abs($hi)*2^64 + abs($lo)}]"
Four sample runs:^^^
~$ ./random.tcl
Your 128-bit random number is: 12845925169244013330
~$ ./random.tcl
Your 128-bit random number is: 12267131317558982811
~$ ./random.tcl
Your 128-bit random number is: 10434877321040400260
~$ ./random.tcl
Your 128-bit random number is: 16618556391581443091
Well, Rich (and maybe you) should also show things to the community here, which can be discussed, otherwise this place is getting pretty boring.
On 08/03/2025 21:32, Rich wrote:
<snip>
Looking at the source, how does someone with pencil and paper perform
this magic?:
n, _ := rand.Int(rand.Reader, max)
Roll some dice.
d4 give you two bits at a time, d8 give you three, or d16 give
you four. Quick and easy. Or if you prefer decimal, d10s are also
readily available.
As well, with just pencil and paper, obtaining a Unix epoch is quite
an interesting 'by hand' calculation in order to perform this:
epochTime := time.Now().Unix()
You can skip that part by pretending it's 1970.
Rich in sci.crypt:
Ok, here's a simple random number generator using /dev/urandom:
#!/usr/bin/tclsh
set fd [open /dev/urandom {RDONLY BINARY}]
binary scan [read $fd 16] ww hi lo
close $fd
puts "Your 128-bit random number is: [expr {abs($hi)*2^64 + abs($lo)}]"
Interesting. But what is "ww"?
16 * 8 = 128 -> OK, but ...:
Four sample runs:^^^
~$ ./random.tcl
Your 128-bit random number is: 12845925169244013330
~$ ./random.tcl
Your 128-bit random number is: 12267131317558982811
~$ ./random.tcl
Your 128-bit random number is: 10434877321040400260
~$ ./random.tcl
Your 128-bit random number is: 16618556391581443091
64 (?)
| $ echo 'l(16618556391581443091)/l(2)' | bc -l
| 63.84942886744934185453
But I'm not entirely sure if I'm on the right track.
Richard Heathfield <rjh@cpax.org.uk> wrote:
On 08/03/2025 21:32, Rich wrote:
<snip>
Looking at the source, how does someone with pencil and paper perform
this magic?:
n, _ := rand.Int(rand.Reader, max)
Roll some dice.
d4 give you two bits at a time, d8 give you three, or d16 give
you four. Quick and easy. Or if you prefer decimal, d10s are also
readily available.
True, that will work. Die for generating, pencil and paper for
'recording' the result.
However, if one had pencil, paper, and no die anywhere?
$ echo ThankyouRichardfortheniceideathisisreallyfun | spiro -f out.txt Encoded matrix:
niceideT
entwE3ah
huZg3Jta
tfKvffhn
ryQo9mik
ol36p8sy
flaersio
drahciRu
On 08/03/2025 19:11, Stefan Claas wrote:
Well, Rich (and maybe you) should also show things to the community here, which can be discussed, otherwise this place is getting pretty boring.
Okay. How about a new primitive? (I /think/ it's new, but of course
there's nothing new under the sun so I might be mistaken.)
Take 8 consecutive bytes, imagine them as a square of 8x8 bits, and 'tumbleweed' the bits clockwise.
That is, turn this:
abcdefgh
ijklmnop
qrstuvwx
yzABCDEF
GHIJKLMN
OPQRSTUV
WXYZ0123
456789+=
to this:
4WOGyqia
5XPHzrjb
6YQIAskc
7ZRJBtld
80SKCume
91TLDvnf
+2UMEwog
=3VNFxph
The inverse is of course to tumbleweed them anticlockwise.
Sort of gives a new spin to bit rotation.
Stefan Claas wrote:
$ echo ThankyouRichardfortheniceideathisisreallyfun | spiro -f out.txt Encoded matrix:
niceideT
entwE3ah
huZg3Jta
tfKvffhn
ryQo9mik
ol36p8sy
flaersio
drahciRu
$ echo Thequickbrownfoxjumpsoverthelazydog | spiro | scos e 47 11
.MGerqyy
?%TU.l07
]c(F:mkz
)58h[I46
+_.YXTy5
5<\JB\Yo
^&8&GLed
02+ADRMg
Marcel Logen <333200007110-0201@ybtra.de> wrote:
[...]Interesting. But what is "ww"?
Partially an attempt to make an unspoken point. For those of us who
don't know go, reading go code can leave us /wondering/ what's going on
(at least until we dig into the go docs enough to figure it out).
The real explanation is it is the Tcl binary command operator for
| $ echo 'l(16618556391581443091)/l(2)' | bc -l
| 63.84942886744934185453
But I'm not entirely sure if I'm on the right track.
Ugh..., no, you are right. ^ is xor. ** is power. The code should be:
Stefan Claas wrote:
Stefan Claas wrote:
$ echo ThankyouRichardfortheniceideathisisreallyfun | spiro -f out.txt Encoded matrix:
niceideT
entwE3ah
huZg3Jta
tfKvffhn
ryQo9mik
ol36p8sy
flaersio
drahciRu
$ echo Thequickbrownfoxjumpsoverthelazydog | spiro | scos e 47 11
.MGerqyy
?%TU.l07
]c(F:mkz
)58h[I46
+_.YXTy5
5<\JB\Yo
^&8&GLed
02+ADRMg
Slightly improved:
Richard Heathfield <rjh@cpax.org.uk> wrote:
On 08/03/2025 21:32, Rich wrote:
<snip>
Looking at the source, how does someone with pencil and paper perform
this magic?:
n, _ := rand.Int(rand.Reader, max)
Roll some dice.
d4 give you two bits at a time, d8 give you three, or d16 give
you four. Quick and easy. Or if you prefer decimal, d10s are also
readily available.
True, that will work. Die for generating, pencil and paper for
'recording' the result.
However, if one had pencil, paper, and no die anywhere?
Rich <rich@example.invalid> writes:
Richard Heathfield <rjh@cpax.org.uk> wrote:
On 08/03/2025 21:32, Rich wrote:
<snip>
Looking at the source, how does someone with pencil and paper perform
this magic?:
n, _ := rand.Int(rand.Reader, max)
Roll some dice.
d4 give you two bits at a time, d8 give you three, or d16 give
you four. Quick and easy. Or if you prefer decimal, d10s are also
readily available.
True, that will work. Die for generating, pencil and paper for
'recording' the result.
However, if one had pencil, paper, and no die anywhere?
How may sides does the pencil have? ;-)
On 11/03/2025 19:11, Rich wrote:
Ben Bacarisse <ben@bsb.me.uk> wrote:
Rich <rich@example.invalid> writes:
Richard Heathfield <rjh@cpax.org.uk> wrote:
On 08/03/2025 21:32, Rich wrote:
<snip>
Looking at the source, how does someone with pencil and paper perform >>>>>> this magic?:
n, _ := rand.Int(rand.Reader, max)
Roll some dice.
d4 give you two bits at a time, d8 give you three, or d16 give
you four. Quick and easy. Or if you prefer decimal, d10s are also
readily available.
True, that will work. Die for generating, pencil and paper for
'recording' the result.
However, if one had pencil, paper, and no die anywhere?
How may sides does the pencil have? ;-)
A round pencil, with no sides. :)
You've got paper, though.
https://www.professororigami.com/how-to-make-an-origami-cube/
:-)
Ben Bacarisse <ben@bsb.me.uk> wrote:
Rich <rich@example.invalid> writes:
Richard Heathfield <rjh@cpax.org.uk> wrote:
On 08/03/2025 21:32, Rich wrote:
<snip>
Looking at the source, how does someone with pencil and paper perform >>>>> this magic?:
n, _ := rand.Int(rand.Reader, max)
Roll some dice.
d4 give you two bits at a time, d8 give you three, or d16 give
you four. Quick and easy. Or if you prefer decimal, d10s are also
readily available.
True, that will work. Die for generating, pencil and paper for
'recording' the result.
However, if one had pencil, paper, and no die anywhere?
How may sides does the pencil have? ;-)
A round pencil, with no sides. :)
Richard Heathfield <rjh@cpax.org.uk> wrote:
On 11/03/2025 19:11, Rich wrote:
Ben Bacarisse <ben@bsb.me.uk> wrote:
Rich <rich@example.invalid> writes:
Richard Heathfield <rjh@cpax.org.uk> wrote:
On 08/03/2025 21:32, Rich wrote:
<snip>
Looking at the source, how does someone with pencil and paper perform >>>>>>> this magic?:
n, _ := rand.Int(rand.Reader, max)
Roll some dice.
d4 give you two bits at a time, d8 give you three, or d16 give
you four. Quick and easy. Or if you prefer decimal, d10s are also
readily available.
True, that will work. Die for generating, pencil and paper for
'recording' the result.
However, if one had pencil, paper, and no die anywhere?
How may sides does the pencil have? ;-)
A round pencil, with no sides. :)
You've got paper, though.
https://www.professororigami.com/how-to-make-an-origami-cube/
:-)
I admit defeat. :) With this one can create a 'die' from paper. It
may be biased (in that one side may very well weigh slightly more than another) but barring massive bias it should be random enough.
Richard Heathfield wrote:
On 08/03/2025 19:11, Stefan Claas wrote:
Well, Rich (and maybe you) should also show things to the community here, >>> which can be discussed, otherwise this place is getting pretty boring.
Okay. How about a new primitive? (I /think/ it's new, but of course
there's nothing new under the sun so I might be mistaken.)
Take 8 consecutive bytes, imagine them as a square of 8x8 bits, and
'tumbleweed' the bits clockwise.
That is, turn this:
abcdefgh
ijklmnop
qrstuvwx
yzABCDEF
GHIJKLMN
OPQRSTUV
WXYZ0123
456789+=
to this:
4WOGyqia
5XPHzrjb
6YQIAskc
7ZRJBtld
80SKCume
91TLDvnf
+2UMEwog
=3VNFxph
The inverse is of course to tumbleweed them anticlockwise.
Sort of gives a new spin to bit rotation.
This is a really nice idea! :-)
Richard Heathfield in sci.crypt:
for(i = 0; i < n; i++)^^
{
for(j = 7; j >= 0; j--)
{
fprintf(stdout, "%d", !!(b[i] & (1 << j)));
What does this do? Is it necessary?
(As you see, I'm not a C programmer. ;-)
}
putchar('\n');
}
printf("--------\n");
}
int main(void)
{
unsigned char t[8] = {31, 41, 59, 26, 53, 58, 97, 32};
unsigned char r[8] = {0, 0, 0, 0, 0, 0, 0, 0};
unsigned char l[8] = {0, 0, 0, 0, 0, 0, 0, 0};
puts("t first");
dump(t, 8);
puts("now turn it right 90 deg");
tuwer(r, t);
dump(r, 8);
puts("and back again");
tuwel(l, r);
dump(t, 8);
"dump(l, 8);" (?)
return 0;[...]
}
#define BIT_QRY(x,i) ((x[(i)>>3] & (1<<((i)&7)))!=0)
#define BIT_SET(x,i) (x)[(i)>>3]|=(1<<((i)&7))
#define BIT_CLR(x,i) (x)[(i)>>3]&=(1<<((i)&7))^0xFF
Can you explain this a little bit?
Tell you what, I'll let my source code do the talking and give
you a demo run at the end:
tuwetest.c: gcc -o tuwetest tuwetest.c tuwe.c^^
#include "tuwe.h"
#include <stdio.h>
static void dump(const void *vb, int n)
{
int i = 0;
int j = 0;
const unsigned char * b = vb;
for(i = 0; i < n; i++)
{
for(j = 7; j >= 0; j--)
{
fprintf(stdout, "%d", !!(b[i] & (1 << j)));
}
putchar('\n');
}
printf("--------\n");
}
int main(void)
{
unsigned char t[8] = {31, 41, 59, 26, 53, 58, 97, 32};
unsigned char r[8] = {0, 0, 0, 0, 0, 0, 0, 0};
unsigned char l[8] = {0, 0, 0, 0, 0, 0, 0, 0};
puts("t first");
dump(t, 8);
puts("now turn it right 90 deg");
tuwer(r, t);
dump(r, 8);
puts("and back again");
tuwel(l, r);
dump(t, 8);
return 0;[...]
}
#define BIT_QRY(x,i) ((x[(i)>>3] & (1<<((i)&7)))!=0)
#define BIT_SET(x,i) (x)[(i)>>3]|=(1<<((i)&7))
#define BIT_CLR(x,i) (x)[(i)>>3]&=(1<<((i)&7))^0xFF
On 15/03/2025 19:44, Marcel Logen wrote:
Okay. In C, ! is the `not' operator.
0 is false, 1 is true, non-zero is true, but not true is false. So:^^^^^^^^^^^^^^^^
x = 6;
printf("%d", x); prints 6.
printf("%d", !x); prints 0 because not non-zero is false.
printf("%d", !!x); prints 1 because not not non-zero is true.
So !!x maps 0 to 0 and everything else to 1. If you're printing
bits, it's just the job.
[...]#define BIT_QRY(x,i) ((x[(i)>>3] & (1<<((i)&7)))!=0)
#define BIT_SET(x,i) (x)[(i)>>3]|=(1<<((i)&7))
#define BIT_CLR(x,i) (x)[(i)>>3]&=(1<<((i)&7))^0xFF
Say i is 77, which is
01001101
i >> 3 gives us 00001001, or 9.
i & 7 gives us 00000101, or 5.
So these macros respectively query, set, or clear bit 5 of byte 9
(counting from x).
A somewhat hurried explanation, so feel free to ask further.
Richard Heathfield in sci.crypt:
On 15/03/2025 19:44, Marcel Logen wrote:
[...]
Okay. In C, ! is the `not' operator.
I was aware of that. So I thought that the double exclamation
mark was superfluous.
0 is false, 1 is true, non-zero is true, but not true is false. So:^^^^^^^^^^^^^^^^
This is probably the crucial point.
x = 6;
printf("%d", x); prints 6.
printf("%d", !x); prints 0 because not non-zero is false.
printf("%d", !!x); prints 1 because not not non-zero is true.
So !!x maps 0 to 0 and everything else to 1. If you're printing
bits, it's just the job.
A good trick! So a kind of normalization, AFAICS.
[...]
[...]#define BIT_QRY(x,i) ((x[(i)>>3] & (1<<((i)&7)))!=0)
#define BIT_SET(x,i) (x)[(i)>>3]|=(1<<((i)&7))
#define BIT_CLR(x,i) (x)[(i)>>3]&=(1<<((i)&7))^0xFF
Say i is 77, which is
01001101
i >> 3 gives us 00001001, or 9.
i & 7 gives us 00000101, or 5.
So these macros respectively query, set, or clear bit 5 of byte 9
(counting from x).
A somewhat hurried explanation, so feel free to ask further.
I'll take a closer look at this. For now, your explanation is
good enough for me. Thanks.
I knocked up a quick sieve for you so that you can see the macros
being used in another context - here, to tick off compounds (by
which I mean non-primes) a la Eratosthenes.
(I also fixed a tiny
and probably harmless bug in BIT_QRY, where x was insufficiently >parenthiprotected.)
#include <stdio.h>
#define BIT_QRY(x,i) (((x)[(i)>>3] & (1<<((i)&7)))!=0)
Richard Heathfield in sci.crypt:
#define BIT_QRY(x,i) (((x)[(i)>>3] & (1<<((i)&7)))!=0)
This is actually another C question:
Why does it have to be "(x)" and "(i)" everywhere instead of
"x" and "i"? What kind of "protection" is meant here?
On 16/03/2025 14:57, Marcel Logen wrote:[...]
Richard Heathfield in sci.crypt:
#define BIT_QRY(x,i) (((x)[(i)>>3] & (1<<((i)&7)))!=0)
This is actually another C question:
Why does it have to be "(x)" and "(i)" everywhere instead of
"x" and "i"? What kind of "protection" is meant here?
If in doubt, steer well clear of side effects in macros.
Richard Heathfield in sci.crypt:
On 16/03/2025 14:57, Marcel Logen wrote:
Richard Heathfield in sci.crypt:
[...]#define BIT_QRY(x,i) (((x)[(i)>>3] & (1<<((i)&7)))!=0)
This is actually another C question:
Why does it have to be "(x)" and "(i)" everywhere instead of
"x" and "i"? What kind of "protection" is meant here?
If in doubt, steer well clear of side effects in macros.
Ah, OK, all this refers to macros.
I had initially assumed that it was generally about paren-
theses around variable names.
On 16/03/2025 22:21, Marcel Logen wrote:
Ah, OK, all this refers to macros.
I had initially assumed that it was generally about paren-
theses around variable names.
No, I think that'th Lithp.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 02:29:51 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,582 |