« first day (1644 days earlier)      last day (3322 days later) » 

5:01 AM
Anyways, change of topic:
0
Q: Allow multiple voting

hildredThe goal is to have the best answer on top, not penalize good answers and not have complicated the rep balance. The scenario There are some really good questions which ask exactly what you want to know so you up vote the question without significantly affecting its three digit score. You eagerl...

 
terrible
 
I’m glad meta exists to draw such people away from non-meta.
 
@sehe Curb my enthusiasm? :(
 
yooooooooooo
what up boys
???
@fredoverflow up for a little challenge?
 
wassup vimzy welcum to the Crib<C++> my nigga
 
5:09 AM
yeeeee been a long time coming haha
 
> /* Must be an alias template to avoid self-immolation */
Perfectly clear comment.
 
9/10 would maintain
 
lol
Got a quick virtual memory related question for you, anyone up for it?
 
ask and find out
 
To clarify I haven’t committed it yet :v But I feel like a novel wouldn’t explain it better.
 
5:12 AM
Just link to the bug report or c/c the error idk
 
If we have a 32 bit address space with page sizes of 4096 bytes. How many entries are there in each page table? The answer is about 1 million, but how does one determine this?
 
one divides
 
@Cicada 'Self-immolation' is actually a term in the Standard. So it’s the key to the whole thing.
 
one divides by what ma nigga
 
Wow. It's early.
 
5:14 AM
@LucDanton ... really?
 
@Vimzy 2^32/2^12 = 2^20 ~ 1mil
 
@Cicada So how did you know that 32 bit address space is covered by 524288 pages?
 
I didn't, I forgot 1 bit (see Jeremy's post above)
 
2^32 / 4096 = 1048576
Is that the answer?
 
yeah that is!
 
5:17 AM
@fredoverflow yes
 
good work boys
:D
 
I didn't even bother to read the whole thing.
And there I was fearing you might ask about template metaprogramming or whatnot.
 
@Cicada maybe ;)
 
I mean, how exactly is dividing by 4096 a challenge?
 
@Cicada Yes, really. "When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation."
 
5:19 AM
@fredoverflow :lol
 
I was just testing you guys...
 
> I was just testing you guys
What. Are you testing us?
 
@fredoverflow I can name that instruction in three bytes. Shr eax, 12
 
@JerryCoffin Oh, yes, I forgot that one
 
@Cicada, yes sir
up for another one?
 
5:21 AM
US-MIL-STD-882D
 
standard military big boobies
 
Apparently I just found out that Hawaii will have the first rail system in the United States to bear a driverless system
(never because Hawaii gov't projects suck)
 
@Cicada nah i'm playing, prof just gave me answer i couldn't remember how to do it...
 
But still cool
 
So I had an alias using foo = blah; which I suspect (hard to come up with an SSCCE) to lead to self-immolation. But it’s a convenience alias which I only really use in member function definition, so I can turn it into an alias template so that simply instantiating the current class template doesn’t go bad.
 
5:23 AM
@Vimzy Did we pass?
 
@fredoverflow nearly, 49.4%
 
That missing 0.6% is gonna gnaw at me for the rest of the day.
 
simmer down ma nigggg
Try this one: Cache line size is 8 bytes,
Total size of the cache is 128k bytes,
Memory addresses are 22 bits,
Then how many slots are there? How many bits are there?
 
lol
Someone is attempting to trick Lounge in doing their HW
 
No i'm prepping for an exam
lol
 
5:26 AM
All the more reason for us to give wrong answers tbh
 
wtf is a slot
 
Every done any cache stuff?
 
Yeah I heard @R.MartinhoFernandes is in geo cache or stuff
 
bring em in
lol this is basic stuff tho, i'm just rusty AF
 
explain this
>>> 1/90
0.011111111111111112
 
5:28 AM
so uhhh
@orlp Binary is terrible at approximating some numbers that we have perfect solutions for in base-ten, like how we can probably divide 1/3 perfectly in ternary, but not in base 10
 
that's cringe worthy brah
 
I'm aware
 
@orlp So what's the problem?
@Vimzy Hey looks like you're ahead of me
So uh...
Does that mean there are 16k addresses?
 
There are 2^22 total addresses!
I'm confused about how to determine number of slots/bits in terms of cache
 
@Vimzy Of courese.
Um...
Well if the cache is 128k bytes
and the cache line size is 8 bytes
 
5:32 AM
yea we just divide right?
 
then it should have 16k addresses?
and then 128k bits?
 
@Cinch the reason I'm skeptical is this:
 
@orlp interesting
 
actually
no it makes perfect sense
 
@Cinch How would we determine the bits? Isn't that just 128k multiplied by 8? (1 byte = 8 bits)
How could it be 128k bits?
 
5:35 AM
Can't you take your cache problems to your local bank?
 
@orlp Isn't that a double?
So...
 
@fredoverflow lol
 
@Vimzy no we have 16k addresses?
 
ugh idk
 
5:36 AM
@fredoverflow I did, and got a miss
 
i guess we have 128k * 8
 
yea that's what I was thinking. seem right?
 
2 hours ago, by Feeds
I honestly didn't think you could even USE emoji in variable names. Or that there were so many different crying ones.
haha love it
 
@Vimzy i guess
I haven't done this yet but I agree??
 
@Vimzy I can already hear the wedding bells. "Student finds his love Miss Cache at local bank."
2
 
5:39 AM
@orlp It appears it's 17 digits of precision
 
@fredoverflow so many puns in that one
 
@orlp which makes a lot of sense
I wonder where the rest of those digits come from though
Overflow?
 
today I answered a question
how many sets of numbers can you make out of "2015"
 
@ThePhD Well, at least he didn't propose a Singleton.
 
5:41 AM
@orlp repeats allowed?
 
@orlp I don't get it. Please clarify.
 
if you can split the number up at any digits (for example 20 and 15), put a decimal point anywhere (.20 and 1.5), or make a repeating decimal (2.105~~ == 2.10505050505)
 
@orlp Oh that's what you mean.
It's infinite.
 
no it's not
 
If I go into base-5+ it is
OPEN YOUR MIND TO THE BASELESS WORLD OF BEYOND 10!
 
5:42 AM
it's not infinite in any base
 
@orlp If there are an infinite amount of bases yes
 
@Cinch what the fuck are you even talking about
 
@orlp Everything and nothing
 
@Mysticial What is MBA?
 
@fredoverflow Master of Business Administration
 
5:43 AM
@fredoverflow Masters in Business Admisistration
 
@Cinch Every base is 10 in its own base.
 
@orlp But in an infinity of bases, it's infinite (as long as you count each grouping as distinct in each base, even though it's lexically indistinguishable).
 
@fredoverflow But we can reinterpret 2015 as something different in heximal
and something different in septimal
and something different in octal
 
@JerryCoffin you have to interpret the numbers for uniqueness
 
@orlp I'm just messing with you
 
5:44 AM
20, 15 is not different from 20., 15
or 2.0 isn't different from 2.0~
 
@orlp What if I define . to be i?
Then we open our minds to the complex reality of imagination!
 
What about you calm the fuck down
 
either way, to my knowledge the answer seems to be 204: gist.github.com/orlp/e76014113ab8a2c29589
 
@orlp That's my point. 2015 has one value in base 10. It has a separate and distinct value in base 11. Another different value in base 12, and so on. So without doing any gropuing at all, just leaving it as 2015, you can as many different values as you use bases--and since you can use any number greater than 5 as the base, it has infinite values just as 2015.
 
@orlp It doesn't rearrange around the numbers.
 
5:45 AM
> Warning: this comic occasionally contains strong language (which may be unsuitable for children), unusual humor (which may be unsuitable for adults), and advanced mathematics (which may be unsuitable for liberal-arts majors).
lol, never noticed that XKCD warning before
 
@JerryCoffin your argument makes the number of unique outputs larger, I agree
@JerryCoffin but once you get the base 2015 your argument no longer holds, as every value in base 2015 made through this method has the same value in base 2016
 
@orlp dude
you're asking if we were to take 2015 and do whatever we wnated with the digits
 
@Cinch I never said you were allowed to rearrange
 
you didn't give the requirement!
 
@Cinch It's just converting the base 2 representation to base 10. He's asking for more precision than a double-precision float can represent, so after a certain point, you'll see the random crap at the end
 
5:46 AM
no
 
tl;dr - math.
 
@Jeremy Ahhhh
 
I said split up, put decimal dots, and make repeating decimals
 
So it's undefined?
 
@orlp Does "decimals" imply base ten?
 
5:47 AM
I never said you were allowed to do 'whatever you want', nor did I say you were allowed to rearrange
 
not really undefined. you can figure out exactly what teh bits are in the double precision float for 1./90
 
@orlp Well at least it's clear now
@Jeremy Idk I don't know what to think
 
And convert whatever that is to base 10 - you'll get what orlp there
 
I don't care, I'm gonna put 2015 through SHA-1 and let the result count as valid. #yolo
 
@orlp Not true. In base 2015, it's 5 + 1 * 2015 + 2 * (2015^3). In base 2016, it's 5 + 1 * 2016 + 2 * ( 2016^3) [and so on for all higher powers).
 
5:48 AM
Where do they come from?
 
@fredoverflow the fractional part!
 
@JerryCoffin whoopdiedoo you're right
nevvvver mind
 
@JerryCoffin I am a higher power
 
it's the opposite way around
 
No if we do 1./90 where do the extra digits come from? The memory to store the correct digits shouldn't be there and read-overflow shouldn't happen
If we were to do that we could eventually trigger a segfault in some situation if it were dire enough
 
Or does C++ simply optimize the constant?
 
@Cicada Already practicing for 420 day, eh?
 
@Cinch double has room for approx. 16 decimal digits
 
@fredoverflow Yes so where do the extra come from?
 
What extra?
 
@JerryCoffin I had to look it up...
 
@fredoverflow 15 round-trip-return, 17 in double->decimal
 
@Cinch From converting base 2 to base 10, because he asked for more digits
 
@Jeremy ...No I mean after the precision limit that is specified
 
@Cinch ...right...
 
5:49 AM
Obviously the math is right but at the end is where I'm puzzled
 
Go ahead and try it on a simple example
like 1/3
figure out what the (single)-precision float is
 
@JerryCoffin my line of thought was for the scenario where you're supposed to convert the number '2015' to base-n, in that case the result no longer changes once you get to base 2016
 
that best approximates it
and convert that to base 10
 
@Jeremy That's not what I'm asking! God I know how binary works!
 
either way, infinite bases is stupid :P
 
5:50 AM
the base 10 decimal never terminates
 
@Cinch Oh you mean because it has 17 digits instead of 16? That's because the first significant decimal digit only needs one bit. So you get one "half-digit" extra at the end which cannot be 1 but only 0 or 2.
 
@fredoverflow NO!
I mean where do the 20th+ digit come from?
 
What are you talking about? There are only 17 significant digits in the output.
 
No, there are a LOT more if we disregard the precision limits
 
5:51 AM
@JerryCoffin Looks like a song a functional programmer would sing!
 
5
Q: Two-zero-one-five puzzle

Uri ZarfatyBackground This puzzle is a variation on the four fours puzzle (itself the topic of a past question). Like that puzzle, the aim is to find mathematical expressions for different whole numbers, using only four digits and certain mathematical operators. In this case, however, the permitted digits ...

 
@Cinch I know you know how binary works, but I think you're missing a piece here. C++ is just converting the base 2 approximation of (eg) 1/90 to base 10. it's not actually converting 1/90.
 
0.011111111111111112
   ^^^^^^^^^^^^^^^^^
17, not 20
 
either way, that's the bigger puzzle^
 
@fredoverflow No, I mean what about the 18th digit
or the 19th
Where do these digits come from?
 
5:52 AM
@Cicada Could have been written by Haskell Curry himself!
 
Obviously the answer is correct up to the point we ask
 
@JerryCoffin now what if we get real bases
@JerryCoffin like phinary
 
@Jeremy (I know that all I'm asking is where the extra digits come from after the precision limit and approximation cutoff when we print it out)
 
@Cinch What is 2^-128 in decimal? How many significant bits does it use in binary?
 
@Cinch And I'm telling you the answer.
 
5:53 AM
@Jeremy No you're telling me why the digit is rounded or truncated
But on Coliru the output is over 30 digits long
 
because he did std::setprecision(30) or whatever
 
You can get up to 53 digits if you want to.
 
@Jeremy Yeah I know
@fredoverflow Okay this is what I'm looking for
 
@JerryCoffin no, phinary
@JerryCoffin the golden base
 
5:54 AM
And on x86 we shouldnt be able to get more than 80-bit precision???
 
2^-1 = 0.5
2^-2 = 0.25
2^-3 = 0.125
2^-4 = 0.0625
2^-5 = 0.03125
Note how each bit requires another decimal digit as well.
Also note that each number ends in "...5"
So a lot of digits are predetermined by what comes before.
 
@fredoverflow Yes, I know because it is rounded or truncated because it cannot have infinite precision
What I'm asking is what are those digits beyond the precision limit?
We don't get 500 digits of precision if I ask for it
 
@orlp Oh, Phinary.
 
You get exactly 53 bits of precision, so you can ask for up to 53 decimal digits. But everything after ~16 digits won't carry additional information.
 
@fredoverflow Okay then.
@fredoverflow Right.
So what IS that information that's not the 16 digits?
It's not the correct number from my assumptions
So what IS it?
 
5:58 AM
double a = 0.1;
System.out.println(new BigDecimal(a));
double b = Double.longBitsToDouble(Double.doubleToLongBits(a) - 1);
System.out.println(new BigDecimal(b));
Java to the rescue. Output:
0.1000000000000000055511151231257827021181583404541015625
0.09999999999999999167332731531132594682276248931884765625
Your question is "What is 55511151231257827021181583404541015625", right?
 
@fredoverflow right.
 
@Cinch Actually, it is! The number is wrong without the additional digits.
 
@fredoverflow Sorry what.
 

« first day (1644 days earlier)      last day (3322 days later) »