« first day (829 days earlier)      last day (4345 days later) » 

16:00
@thecoshman lol
Hence NaN == NaN should yield "Bananas", who'd expect that?
@TonyTheLion trust you to be the first one to click it :P
@LucDanton In Hell++ std::cout << ((0.0/0) == (0.0/0)); outputs "🍌🍌".
(Nah, that's not allowed :/)
@EtiennedeMartel I am hungry, grrrrr
16:02
lol
You called?
Oh, wow.
It worked :)
@JerryCoffin yeah, agreed, I'm just thinking that if you get a "surprise NaN" in your code because of bad inputs or code errors or something, then treating them as not equal is probably going to break less code. If you start treating the results of different computations with different inputs as equal, then you'll likely trip up a lot of code in nasty ways
but yeah, conceptually, I agree with you
16:03
¬_¬ let's try this @manWithFreeBeerToGiveOut
21 mins ago, by Etienne de Martel
I wonder how useful it is to have a NaN that is not equal to itself.
We were wondering if you would know :)
@jalf if your code let's inputs result in a NaN, it's already broken
@R.MartinhoFernandes: it's not so much that it's useful to have x != x when x is NaN as it is that the other alternative is simply wrong.
@thecoshman Not at all. Do you think they'd have included it in the standard if its only use was to indicate that code that produced it was broken?
16:05
@thecoshman It's not necessarily FUBAR, though, as you can check for NaNs and treat them some way.
@TonyTheLion that's obviously not legitimate rape
A lot of the semantics involving NaNs are decided by simply choosing the most innocuous of a set of unsatisfying options.
@JerryCoffin yes
@sehe it was funny though.
@thecoshman It would be much simpler to just call it UB.
16:07
@thecoshman Then you'd be wrong.
@JerryCoffin hardly
@thecoshman: NaN can very much be the appropriate result. The obvious example would be sqrt(-1). There is no floating point number that is appropriate to return, so it is correct to return NaN instead.
That's not broken.
@StephenCanon Ah, like sqrt(-42) == sqrt(-43) or simply wrong in some other fundamental manner?
@StephenCanon no, but letting that user input be tested for in the first place. I'll give you that return NaN is the best thing to do if given such a value, but the code taking user input should check it first
ok, so what does the code checking the user input return?
16:09
@thecoshman You're going to need to provide some pretty serious backing if you want anybody to take your opinion over, for one obvious example, William Kahan's, when it comes to the best way to support F.P. computation.
@JerryCoffin nah, :P
fucking things suck. 1 return per function is really sensible, if you're not using normal C++ objects, but sucky C api instead -.-
@TonyTheLion missed the point/reference?
@StephenCanon what do you mean? I am saying that you should react to the bad input before even using it, rather then try to do something with it, and find out the maths doesn't work
@sehe I did. Did you expect me to get some obscure reference/point?
16:10
I don't know about you, but I would stop walking before I fall of a cliff, rather then have my legs repaired afterwards
@TonyTheLion not obscure
@BartekBanachewicz nah, returning lists is nice :P
@thecoshman: you need to keep in mind that detecting "bad" user input is usually much more involved than if (x < 0). A typical routine will have many inputs, and describing which subset of the possible input space produces bad results may be extremely difficult and inefficient. It's much better if you can run the computation and simply check that the result isn't NaN.
@thecoshman Not always -- in a lot of cases it's much faster (and equally reasonable) to just do a computation, and see what comes out, than try to pre-check everything first. In fact, in quite a few cases about the only way to be sure if you're going to get a good result is to do the computation anyway.
@sehe for me it was, since I didn't really get it. obviously
16:11
@thecoshman It could be the result of several computations. Like, you could do several calculations that lead you to two zeros that you then divide. What do you suggest? Preemptively performing those same calculations to check if they lead to two zeros? You can just do the whole shebang and check for NaN at the end.
Oct 26 '12 at 14:32, by sehe
@melak47 well, enjoyable rape is legitimate, unless it's not forcible
Xeo
Xeo
Interesting.
@sehe oh
kek
16:12
@thecoshman you didn't understand. I am not speaking about returning multiple values, but multiple return statements
Consider the task of solving a linear system of equations; determining that the system is ill-posed is just as hard as solving it. The best thing to do is to jump into doing the computation, and produce the error message if and when the computation breaks down.
@Xeo pretty old
@R.MartinhoFernandes I guess...
@sehe oh, that's quite different to the wiki article there before.
I will say though, I've never really thought much about it, and so have tended to jsut go for the see how it goes and test for NaN after
oh, best not get drawn into anything, I want to head home soon
balls to being stuck at work another hour
16:14
@sehe waaaat
@thecoshman Very likely, but to the people defining the IEEE spec, I'd imagine it was still relevant to consider which decision would cause the brokenness to manifest itself in the cleanest, least destructive way
@jalf yeah, as far as simply how to do things like sqrt(-1) then sure, NaN is a sensible return value for that.
@StephenCanon Thanks for showing up, btw. I will add "Summon Floating-Point Expert" to the list of my super powers.
@TonyTheLion and you win this argument :P
16:16
Does the C/C++ standard guarantee that infinities compare to equal?
@thecoshman hahahaha
Or does it say nothing about infinities?
@R.MartinhoFernandes I'm still waiting for my guy with free beer to hand out
You have the right sense of it. The semantics of NaNs were designed with an eye to making it possible to do the following:
1. use a simple algorithm that is fast and correctly handles most cases
2. if nothing went wrong, return the result
3. if something went wrong, replay the computation using a slower but more careful algorithm and return that result
3
@Mysticial doesn't it just fall back on 'let some other spec detail how to deal with numbers'?
16:17
@Mysticial I think they say nothing about it. There is a way to test for IEEE754 conformant behaviour, and that's it.
@BartekBanachewicz that's obviously some reddit-friendly edit of the original 3.bp.blogspot.com/-Py7sfLhQtUM/UImTexNnjZI/AAAAAAAAIw4/…
(sorry imgurring failed in time because network hitch)
Implementations probably mess it up anyway.
I have a branch-and-bound search algorithm that uses infinity to signal an invalid solution. (a cost of infinity)
And I check for it with equality. And I add different costs together. So if any sub-step is invalid, the cost sticks to infinity.
16:19
@StephenCanon does infinity equal infinity? (both positive if that matters)
Which of course works fine with IEEE floating-point.
@Mysticial: so, I don't believe that C or C++ guarantees that infinity exists. But if it does exist, my reading of the C standard is that it must compare equal to itself.
Although I probably shouldn't bother trying to make it work on anything other than IEEE.
Obviously, infinity does exist in most implementations.
any hoops, time for the bus home
16:21
@thecoshman Yes. Only NaN behaves "weird".
See ya' maties
If we ignore GPUs, it's been > 40 years since anyone put together a FP system without infinities, as far as I am aware.
@R.MartinhoFernandes its weird that it acts weird, because it acts weird
16:22
(I'm calling the Cell SPUs a "GPU" here)
@StephenCanon They don't even have denormals either do they?
Is that good or bad?
Please please build please work
Or neither...
16:23
I want to go home and eat
fcuk bus in 4 minutes compile you dipshit
@Mysticial I don't believe there are any significant systems left that are non-IEEE.
@DeadMG Aside from GPUs as Stephen mentions.
those have been IEEE for a while.
@DeadMG: there are still a lot of platforms that are IEEE + quirks. Most ARM platforms run with denormal support turned off, for example.
last I checked, anyway.
16:25
Oh fammit, I should have left for class already. Later peeps.
@BartekBanachewicz okay, sorry
@R.MartinhoFernandes class at 17:00h+?
@sehe umm? sorry for what?
@sbi I want to visit Berlin for a few day in February (from a Thursday to Sunday), I will take care of my own sleeping place, but I just wanted to know if you'd want to go for a beer, and if so, is there a weekend in Feb which is more convenient for you go out?
cc @R.MartinhoFernandes
@R.MartinhoFernandes ah German, I guess
@StephenCanon Right -- but there is a std::numeric_limits<T>::has_infinity() to tell you whether a type has infinity or not.
16:27
@JerryCoffin: agreed.
@BartekBanachewicz for not compiling sooner...
@sehe it broke on afxres.h
wtf it is
@StephenCanon I've been wondering for a while. I have a decently strong VLSI background, but I still can't get my head around it. Exactly how much more area would be needed to make denormals fast?
@BartekBanachewicz standard MFC related include for resource files IIRC
Right now, Sandy Bridge has denormals fast for additions.
But they are still slow for multiplications.
16:29
@sehe umgwhthwhth. It went missing
@R.MartinhoFernandes Mostly bad. Before the first version of IEEE 754 was written, DEC tried to argue that denormals were a bad thing (wanted the VAX g-format standardized), but every argument they advanced was pretty thoroughly destroyed.
@Mysticial: it's not that bad area-wise, but it's hard to do without costing latency if you want to handle them at speed.
@BartekBanachewicz VSExpress? Perhaps do a rebuild on your rc/res things
Like, I don't see anything particularly ugly about denormal floats that makes them difficult to implement in hardware.
"Generated from the TEXTINCLUDE 2 resource." that's the comment above include
16:30
@BartekBanachewicz So, maybe you dropped the resource file itself?
I think rc.exe makes a binary resource file + the header (or something, but it has been yeaaaars since I used this stuff)
@Mysticial: very roughly speaking, for a state-of-the-art implementation, handling denormal multiply results without a replay would cost you one additional cycle of latency on every multiply.
@StephenCanon Like, what would be the costly step in a denormal? If I had to guess it would be trying to shift the decimal point into place? But that's just a simple leading-zero function which can be done fast (1-cycle in integer units?)
user784668
@Mysticial Want fast denormals? Use your GPU.
user784668
Or so I've heard.
Speaking only of x86, the machine is so starved for register names that an extra latency cycle would be hard to work around in FFTs and linear algebra.
16:32
@StephenCanon Interesting. I don't think I've ever heard of this "replay" thing.
innit bruvs
16:33
@Mysticial: they way most modern ALUs handle denormal results is to do the computation, and detect if the result is going to be denormal near the end; if so, they trigger a replay of the computation in microcode (or a pseudo-op that handles the renormalization).
@ScottW It's expected when you reach those numbers. I have 3 downvotes on mine... so...
The internet is full of trolls.
@Mysticial: then the original instruction retires as usual, but simply doesn't the rename / scoreboard to indicate that the result is available.
And people will downvote just out of jealousy.
user784668
Fuck local time.
16:35
@DeadMG What does that mean?
nvm, googled it.
user784668
@ScottW Two infinities.
I greet you and simultaneously imply that you are an idiot
user784668
@ScottW Still less than @Mysticial.
@StephenCanon Oh wow. That's a completely different implementation than what I had imagined. I thought the FPUs internally had larger exponents to handle everything. Then they convert to denormals at the end if it's out of range.
No, you're right;
16:37
@DeadMG Google told me it was slang for "Hi" from stereotypical chavs. :(
they do carry larger exponents internally oftentimes.
It's just usually more efficient in a out-of-order machine to have predictable execution times for each µop.
@StephenCanon That's a detail that I didn't know and I learned something. How an instruction can stall by not updating the scoreboard.
So you want to allow the current operation to finish on schedule, and just issue some new ones to get the right result.
Yeah, a lot of times you'll see the stall attributed to the instruction consuming the result instead for that reason.
(In a profiler)
@Mysticial: your intuition is also right though, on simpler implementations it can make sense to simply have a slow path for the instruction.
16:41
@StephenCanon That's something I'll keep in mind if I ever get down to that level. (which I probably will wherever I start my first job)
That sock question is still that high on the multicollider?
They really need to get rid of the multiple-answers bonus in that formula.
@Mysticial I don't get why math.se questions with like, 6 votes are on the top daily.
@Rapptz It's weighted differently for different sites.
SO, because it's such a large community has a huge handicap factor.
@TonyTheLion Not exactly.
A question from SO will need several hundreds votes to stay atop the multicollider for more than a few hours.
16:53
16
Q: How does "pussy" come to mean "coward"?

cartogramThe word pussy is often used to mean "coward". This guy is a pussy. and I am wondering why. How are woman's genitals related to being a "coward"?

Usually, we see blue states as all right, and red states as full of rednecks.
@Rapptz lol
@EtiennedeMartel: what about blue states full of rednecks? =)
@Rapptz It's more or less number of votes as a percentage of total views on the site. Otherwise, smaller sites would hardly stand a chance.
(northern new england, basically)
16:54
7 downvotes on the question
@StephenCanon Oh, you mean those near the Canadian border?
yeah.
you know, the ones you all drive through on your way to boston / new york.
Good question. I guess I never thought about it.
@Mysticial Which?
I remember when I was studying at Sherbrooke and I saw all those American kids cross over the border on Spring break because they don't have to be 21 to purchase alcohol here.
And suddenly the whole city was filled with douchebags who don't know how to drink properly.
Just because Sherbrooke happened to be the largest city near the border.

« first day (829 days earlier)      last day (4345 days later) »