« first day (831 days earlier)      last day (4135 days later) » 

8:00 PM
@doug65536 locks me into x64, but I guess that's fine.
or I can give up and just use int for by bigint class.
 
@MooingDuck you need an "always works" code path anyway right?
 
@DeadMG true
 
@MooingDuck I'd set it up so there is a standard code path useful for porting or strange architectures, and maybe a couple of tuned ones that require platform support
 
@doug65536 I'd be happy with "works on all modern CPUs"
 
I'd be happy if it works on your mom.
 
8:02 PM
Days Since Last "Your Mom" Joke: 0
 
though I think the only assumption my code makes currently is that long long is at least twice as many bits as char :D
 
lol
 
Only 1110?
 
We can do better than that!
 
8:06 PM
@StackedCrooked 398 messages found in this room
(two of which are this conversation)
(it's now 399, so three of which...)
 
@MooingDuck I forgot to tell you that I don't actually do any arithmetic in that base.
 
I don't trust this chat's search facilities.
One of the results in "@Pubby yeah, mom "
 
It's all done in either base 2^32 or 2^64 depending on whether it's x86 or x64.
 
@Mysticial makes sense
 
you won't get a lot of laughs from adults for mom jokes because some peoples mothers have passed away
 
8:08 PM
@Mysticial though you probably meant to tell Rapptz
 
But the radix conversion will output to an array of 32-bit integers with 10^9 per word in x86. Or an array of 64-bit integers with 10^19 per word.
@MooingDuck both actually
 
I like to stick with powers of 10.
 
The only operation I have that operates on non-binary base arrays is the mod function - used only for error-checking.
 
My division function prints out the decimal places
to 6 digits too
Like what the hell man
there are no floats anywhere, where is it getting these decimal places from ;_;
 
lol
 
8:10 PM
fluffy
 
@Rapptz Is the number of used bytes in the numerator 2 more than a multiple of four?
no wait, 6 decimal digits would be... something else.
 
Is there an implicit conversion from unsigned long long to double anywhere?
 
@Rapptz yes, most primitive types implicitly convert
 
An example -- "10247812812712611728461872674712 / 12345678"
 
@KonradRudolph Ok, interesting.
 
8:15 PM
I have a feeling this compiler-optimization question is gonna go big:
10
Q: Do compilers automatically optimise repeated calls to mathematical functions

Tim MBSay I had this snippet of code: #include <cmath> // ... float f = rand(); std::cout << sin(f) << " " << sin(f); As sin(f) is a well defined function there is an easy optimisation: float f = rand(); float sin_f = sin(f); std::cout << sin_f << " " << ...

 
@Mysticial Well it’s already answered.
Except that Pete doesn’t accept that ;)
 
@Mysticial I was taught that you should save repeated calls to something as a variable because it's more efficient
 
@Crowz doesn't hurt, sometimes helps
 
Compiler usually optimises it but there's nothing to lose if you save it.
 
@Crowz That's correct. I never rely on the compiler to do certain optimizations.
 
8:18 PM
I have a question, actually...
Does a switch statement compile into an if else, or is it more efficient?
 
@Crowz Depends.
If there aren't too many cases, then it probably just does an if-else.
 
Switch was introduced for computed jump afaik
 
If there's a lot of them, then it uses a jump table.
 
@Crowz sometimes
 
If there are a lot of cases, and they are sparse, then it will use a binary search + jump table.
 
8:20 PM
Is there some number of cases where it becomes more efficient?
 
@Crowz probably, but density affects things too
 
If the case values are dense, then it may attempt a direct lookup table of jump address.
 
well, somehow I don't see the decimal places anymore.
I guess I was really tired somehow yesterday
 
@Ell Btw did you manage to connect or not? Tell me now if you need help figuring things out, I might not be here later on tonight.
 
user142019
@TonyTheLion Tony The Sehe?
 
Ell
8:22 PM
@LucDanton The server was up - but I couldn't connect because I don't have fml. I went onto the fml forum post but it wouldn't load - I'll try again now
 
erm
 
I think I've only recently started to massively abuse switch statements for something they're clearly not meant for.
But I can't think of a better way though.
 
Oh, somebody just told me I cannot state that cplusplus.com is shit containing different "little" mistakes, because none of those I linked him to were found by me!
 
0
Q: what does -> do in c++

user1958850I know this is a VERY basic question, but I'm learning from 100% online sources and experimentation so I need the answer and can't ask a search engine because "->" gets sanitized and discarded when I try to. What is "->" and what does it do?

 
Jesus, why are people so dumb?
 
8:23 PM
sure we already have this somewhere?
okay, groceries shopping, see ya guys
 
cya
 
I answered via comments anyway
lol he deleted it
 
yeah I wouldnt even go to a forum with questions that 50000 tutorials cover already
 
user142019
Crème brûlée (; ), also known as burnt cream, crema catalana, or Trinity cream is a dessert consisting of a rich custard base topped with a contrasting layer of hard caramel. It is normally served at room temperature. The custard base is traditionally flavored with vanilla, but is also sometimes flavored with lemon or orange (zest), rosemary, chocolate, Amaretto, Grand Marnier, coffee, liqueurs, green tea, pistachio, coconut, or other fruit. History The exact origins are uncertain, and there have been debates as to whether the dessert's origins lie in France or Britain. The earliest...
 
user142019
I want.
 
Ell
8:28 PM
I just ate lots o brownies
 
user142019
Give me çrèmè brûléè.
 
@MooingDuck boo I can't see.
 
is that comment right? (10k+ users) I thought it was "structure dereference operator"
 
user142019
Lol.
 
user142019
8:29 PM
Undelete and downvote. xD
 
there is an extent to which I hate you all
 
random other people on the internet hating you is standard procedure
 
I'm not random
I am the lord your god!
 
hey
 
user142019
hey
 
8:30 PM
I protest
 
user142019
Me too.
 
I also protest.
 
@Rapptz I haven't checked yet if you've pushed a new version, but the latest one I tried actually stopped working for that A*A-D*B*B problem
 
@MooingDuck Some of them don't really have names.
 
spec seems to just call it the -> operator.
 
user142019
8:30 PM
Lightness doesn't race in orbit.
 
user142019
Your argument is invalid.
 
@MooingDuck I say "indirect" in my head
 
user142019
And you're not my lord.
 
user142019
I am.
 
8:31 PM
5.2.4 "The use of a pseudo-destructor-name after a dot . or arrow -> operator represents the destructor..." That's something I guess :/
 
dem female vocals ;-;
 
@Zoidberg you're wrong
 
Need a lord? Why not Zoidberg?
 
but I'd call it the pointer member access operator, if I had to name it.
 
oh I love van canto :D
 
8:31 PM
@MarcusStuhr Is it with Base 10^19?
because that implementation is bugged, I just wanted to push in case of rollback.
 
@DeadMG "indirect member access operator". pointers don't have members.
 
user142019
Use base 2^go-fuck-yourself.
 
@Rapptz I don't know -- I rolled it back to the version that worked
before the "faster division" was implemented
 
@DeadMG and you may not be accessing a member that's a pointer
 
@Non-StopTimeTravel It accesses a member through a pointer.
 
8:32 PM
there was never any faster division :(
 
@DeadMG not necessarily :)
 
although I don't think division works yet fully either
 
just inaccurate and broken
 
haha
 
@Non-StopTimeTravel It sure does in it's primitive meaning.
 
user142019
8:32 PM
@Non-StopTimeTravel pointees may have members.
 
@DeadMG and your name isn't abstract enough anyway
 
and through almost all sane overloads too
 
@Zoidberg but not pointers
 
i think multiplication worked fine though
 
user142019
@Non-StopTimeTravel who cares.
 
8:33 PM
and subtraction/addition from what i could tell
 
@Zoidberg the lord your god
 
user142019
I'd call it the "arrow operator".
 
it's "indirect member access operator" now, and that's the end of it
please inform the committee of my decision
 
user142019
Because, like everything in C++, the token has way too much meanings.
 
I prefer opeator--> anyway
 
user142019
8:34 PM
operator--> doesn't exist.
 
it does. I've just decided.
 
1627
Q: What is the name of this operator: "-->"?

GManNickGAfter reading "Hidden Features and Dark Corners of C++/STL" on comp.lang.c++.moderated, I was completely surprised that it compiled and worked in both Visual Studio 2008 and G++ 4.4. The code: #include <stdio.h> int main() { int x = 10; while( x --> 0 ) // x goes to 0 { ...

 
user142019
operator-- and operator> are separate functions.
 
@Zoidberg "goes to" operator
 
user142019
@MooingDuck it's not a single operator.
 
user142019
8:35 PM
It's two operators.
 
yea, <- won't work because that would mean less than, unary negate right hand side
 
user142019
You can't overload operator-->.
 
wake up and smell the psychosis
 
user142019
You need to overload operator-- and operator>.
 
8:35 PM
no you can do it just fine @Zoidberg
lern2c++ mmkay
 
user142019
You cannot, you fool.
 
u iz wrongz innitz
 
how about a super-powerful indirect operator: ==>
 
Do you seriously believe that we think operator--> is real?
 
user142019
No.
 
8:36 PM
I don't think anyone did.
 
But you weren't playing along
 
user142019
Do you seriously believe that I seriously believe that you think operator--> is real?
 
You basically ruined it for everyone
 
yeah you did.
 
@Non-StopTimeTravel No, it's definitely real. It's even in two separate parts of the standard. :P
 
user142019
8:37 PM
Good.
 
@Mysticial That makes it doubly real
 
user142019
Because I love ruining other people's days.
 
operator===
 
@Non-StopTimeTravel Exactly.
 
user142019
@MooingDuck is really equal to.
 
8:37 PM
More real than Zoidberg is for me right now
 
=== is in PHP right?
 
Cat Plus Plus will do my homework for me? :o
4
 
user142019
@doug65536 and JavaScript.
 
@doug65536 Js
 
If one wasn't enough. They wanted it in two different places to make sure.
 
8:37 PM
means is same type too?
 
user142019
@Rapptz and PHP.
 
yeah
 
operator=== is the triple-decrement operator
 
operator+++ adds all numbers.
 
operator‡‡‡ is the triple-increment operator
 
8:38 PM
ADD ALL THE NUMBERS
 
+++10 = "1+2+3+4...+10"
 
how about a+++++++++++++++++ is the same thing as a += 16.
because C++ parsers need more ambiguities
 
user142019
My favourite pseudo-operator is the Perl Goatse operator, =()=.
 
finally, operator₪₪₪ is the triple-excrement operator
@Zoidberg likes people operating his goatse
 
8:39 PM
=()= looks like -o-
 
user142019
Is there also a douchebag operator that makes pictures of you appear on the screen?
 
@Zoidberg :D:D
 
operatorGOD
 
user142019
class GOD {};
 
8:39 PM
> error: \uD83D is not a valid universal character
aw
 
user142019
operator GOD() { throw no_such_entity{}; }
 
@Non-StopTimeTravel wait, it isn't? How do I get unicode characters in there?
U+1F4A9
 
Genius& operator ΑΩ() { return std::reference_wrapper(tomalak); }
(some liberties taken)
 
oh, D83D is the first half of the UTF16, don't know what I was thinking
 
@MooingDuck not sure
 
user142019
8:41 PM
setVolume

public void setVolume(int level)
Set the current volume of the sound between 0 (off) and 100 (loudest.)
Parameters:
    level - the level to set the sound volume to.
 
operator \uD83D\uDCA9?
 
user142019
lol is it really necessary do document the fucking parameters. T_T
 
user142019
Greenfoot why are you so fucking terribru.
 
@Zoidberg his boss said so probably
 
user142019
Tomorrow I'll be done with this shit forever.
 
8:42 PM
@Zoidberg yes, since INT_MAX is not a valid parameter.
 
Parameters:
    metres - the number of metres
 
user142019
@MooingDuck the level to set the sound volume to. I mean that part.
 
@MooingDuck Correct - the function documentation is important. Probably could have done without the dictionary definition of "level" though
 
@Zoidberg but seriously, how would you know 100 = full?
 
@Non-StopTimeTravel yeah
 
user142019
8:43 PM
Sigh.
 
hang on
public void
 
@Zoidberg Real Programmers don't use comments-- the code is obvious!
 
user142019
setVolume

public void setVolume(int level)
Set the current volume of the sound between 0 (off) and 100 (loudest.)
 
user142019
Would be sufficient.
 
8:43 PM
@doug65536 or like RGB where 255 is "all the way"?
 
@Zoidberg yes
 
user142019
There is no need to add an extra "parameters" section to it.
 
user142019
Parameters:
    level - the level to set the sound volume to.
 
setVolume

public void setVolume(int levelFromZeroWhichIsOffToOneHundredWhichIsLoudest)
(Undocumented)
 
public void setVolume(int level) // from 0 to 100
 
user142019
8:43 PM
Is just a waste of bandwidth.
 
far simpler
 
@MooingDuck maybe. or maybe its 1.0 for full brightness. or maybe it's 255.0
 
far more readable
 
@Griwes bit messy though.
 
@Non-StopTimeTravel void setVolume(bound<int, 0,100> volume)
 
8:44 PM
@Griwes something makes me think that'll just get erased by someone. which is not the case with the nice block
 
@Non-StopTimeTravel but one line! </troll^2>
 
@Griwes OH GOODY!!!
block comments are easier to parse into API Documentation, too
rather than splattering little inline comments wherever you please with no pattern nor common form
 
Blah, you shouldn't read documentation, you should read the code itself!
 
they promote keeping up the job
 
wait, my hypothetical bound doesn't signify which is louder :( Should be obvious though.
 
8:45 PM
</troll>
 
@Griwes so when you use the stdlib, you examine libstdc++ to find out what it provides? DO YOU HUH
@MooingDuck try again
 
user142019
Volume should be a floating point number from 0 to 1.
 
@Non-StopTimeTravel No, I check cppreference or standard out, d'oh.
 
user142019
Integer from 0 to 100 is really silly.
 
@Zoidberg even that needs documentation
 
user142019
8:46 PM
I know. I wasn't talking about documentation.
 
zoidbergs criticisms are right - don't say the utterly obvious in a comment
 
user142019
But I understand why Greenfoot doesn't use floating point numbers anywhere.
 
0
Q: using ~ in C++, within a headerfile

user1850434i have a header file... #ifndef DATE_H #define DATE_H class Date { public: // Date(); Date(int=0,int=0,int=2000); ~Date(); void setDate(int,int,int); void printShort(); void printLong(); private: int day; int month; int year; int lastDayInMonth(); ...

 
user142019
It's because Greenfoot is for noobs who don't understand floating point numbers.
 
Go.
we desperately need a "don't be so fucking stupid" close reason in tag c++
 
8:48 PM
yeah SO has a lot of dumb questions.
At least the C++ tag usually downvotes and close
 
@Non-StopTimeTravel Too much potential for abuse.
Alternatively, you can close it as, "This is sooooo fucking stupid, it's not even a real question."
 
please retag to Java? — rhalbersma 1 min ago
 
Ell
since "upgrading" my ISP, internet is slow :'(
 
@MooingDuck lol
 
Alright, so, new feature on that tool I'm working on: the help dialog has pictures of kittens.
 
8:55 PM
@EtiennedeMartel me gusta
 
@EtiennedeMartel you put a cry for help on a help dialog.. how meta
 
oh dear
guis trying to be funny
 

« first day (831 days earlier)      last day (4135 days later) »