« first day (1791 days earlier)      last day (3383 days later) » 

09:00
@VermillionAzure you don't seem to understand what 'pure' means in this context
@thecoshman Purity was just a footnote
lol
It's not important
@VermillionAzure Oh I missed that part
@AnastasiyaAsadullayeva the fool you are talking to
09:00
@Xeo Were you interested in learning about Dependent Types?
G has only two possible outputs: true or false
@thecoshman Sans dec' Poirot
But since we cannot know b, we must say that all values that involve b must be ambiguous or unknown
lol
What the hell are you even going at, @VermillionAzure?
ITT Cinch is inventing data flow analysis
09:01
@AnastasiyaAsadullayeva say what?
@MarcoA. lol
Because it either makes no sense or is incredibly obvious.
Therefore, since all possible outcomes of the function involve b, we have complete ambiguity given the unknown existence of b.
However, let's now look at a function H
Cinch I think your rambling too have complete ambiguity
@VermillionAzure what's your point? that if you don't know the value of an input, you can't determine the output?
That's hardly revolutionary news
09:03
@thecoshman But that's not always true given multiple inputs
bool b;

bool H(unsigned char u) {
	if (u % 2) {
		return true;
	}
	if (b) {
		return true
	}
	return false;
}
Look here.
19 mins ago, by Andy Prowl
@VermillionAzure If something like that existed I'd apply it to like 95% of your questions
If u is even, the output will always be true
(IOW I agree)
But since we don't know b, we cannot reason about the case in which u is not even.
@VermillionAzure Again. What. Are. You. Getting. At?
Is there a conclusion to that
09:04
Therefore, only half of our cases are ambiguous
or is it just terribly obvious analysis of trivial code
which is just a waste of time hth
@Griwes There is a number such that we can measure the ambiguity of the function such that it is equal to the amount of ambiguous cases of output / total possible cases of output
[[half-pure]]
And therefore, ambiguity is measurable.
lol
Xeo
Xeo
09:05
@LucDanton I was, a ... while ago. Don't think I have the time, currently.
@VermillionAzure in the cases, despite being a global, b is still an input, and if you do not know what it's value is, you can't say you know what the output will be in the general case, you can only argue you know what it will be for certain values of certain inputs, which doesn't count.
And... what's the usefulness of that?
@thecoshman It doesn't count towards purity, but the overall idea makes sense.
@Griwes This means that we can now evaluate code for ambiguity by defining a scope
09:05
Also I disagree with your meanings of "ambiguity" and "input".
@Morwenn [[non-aryan]]
and then examining its input/output table.
@VermillionAzure wat
@VermillionAzure What if that table is infinite?
@Griwes How can it be infinite?
09:06
@VermillionAzure std::string -> std::string
With base C++, all types should have a finite size
Natural plusOne(Natural n) { return n + 1; }
C++ is not a good example
Big nums. Vectors. Strings. Sets.
There's a difference between "finite" and "computable".
The fact that a computer has a finite size puts a literal upper bound on the size of any object
09:06
Vectors of sets of bignums.
hey bby u wana c my bignum
There's an infinite amount of values of those.
what you're saying is basically you want to analysis how much the output is determined by n input.
@VermillionAzure If you wanna do formal prooves you're going to have to disregard that
@VermillionAzure Not in terms of the abstract C++ machine.
09:07
CS doesn't care about mere technical details
@AnastasiyaAsadullayeva yeah bby there's a hole in my system fix it pls
Which is the only level where anything like this makes any sense.
@thecoshman I want to measure the amount of cases given a scope and domain that are ambiguous because of external state
If it did we would all be laughing at the halting theorem
@Xeo Just in case there’s a (seemingly) nice upcoming book on programming in Idris. There’s a chapter available for free to see if that’s your cup of tea.
09:08
@AndyProwl k pls pull my branch and merge it in
If we define a given domain and a scope, we have upper and lower bounds on input
We also have a way to define which can be considered explicit and implicit inputs
@AndyProwl Programming with holes is a hot commodity right now in Haskell, Idris, etc.
The importance is that the programmer is able to easily manipulate explicit inputs because they are explicit in syntax directly at the function call
@VermillionAzure to what effect? you want to know how much of a functions out put is controlled by external factors?
@AnastasiyaAsadullayeva k bby done btw you might want to get unit tested, just so u know
09:09
@thecoshman The important part is the number of outputs that are affected by implicit/"hidden" variables
or is this just another one of your ambling I thought this might be of interest so I am going to pursue it blindly
Explicit inputs can be arbitrary and easily controlled
@LucDanton googles like crazy to understand what looks like a joke
@VermillionAzure and where's the value in that?
must have something to do with "type holes" and "dependent types"
09:10
@AndyProwl Yeah that’s one kind of hole.
@thecoshman We have a way to measure if there is ambiguity in our function and also to measure how much there is
so you know that 25% of the possible outputs depend on variables you are not explicitly passing into a function. so what?
45 secs ago, by thecoshman
@VermillionAzure and where's the value in that?
Suppose we have a program that is composed of 10 functions.
@AndyProwl yeah ok
09:11
here we go again
Each function has no arguments, and instead makes references to global variables.
Partial caches.
this time it’ll be the same
@VermillionAzure 10 functions, but in which base?
inb4 "base 10"
impure functions are a pita to work with, we know that, lets move on
09:12
@AnastasiyaAsadullayeva 10 C++ functions
@LucDanton cool, google works. I can now pretend to understand jokes that are more clever than me. Fake it till you make it they say
@thecoshman The important part is that all the inputs are implicit and hidden
it was more like a remark
I don't care how much out put is dictated by 'external' veraibles
> In C, this is easy! It can be done quickly and cleanly by adding some global variables. In purely functional code, this is somewhere between a major rearchitecting of the data flow and hopeless.
FFS
09:12
hello burrtek we missed you collectively
@thecoshman Now, suppose that all input are taken are arguments and by value
@thecoshman hey that's even better than 'verbibols'
@VermillionAzure you mean that the function is pure?
@AndyProwl shut it
berbivols
@VermillionAzure hint: if it's not 0, your code sucks balls
09:13
@thecoshman Yes. Except that it also reads no external state.
you can't have a constant spelling for verybobles
how does that compare to, say, a verbol?
@VermillionAzure ... you mean that is is pure?
@VermillionAzure that's the definition of "pure"
09:14
just the other day I was thinking the lounge hadn't been cinched for a while
@BartekBanachewicz But there must be a way to measure the spread of impurity, yes?
why would you think that
@VermillionAzure It's not useful.
dunno, just an impression
I really don't think it matters how much of a function's output is 'impure', if anything that it outputs is taken by some global state or it's a twat to test and thus a twat to work with.
09:15
Say that we must take 1 external input. This is a given with most programs.
Either it's pure and you can trivially reason about it, or you sooner or later hit the halting problem.
@VermillionAzure When your baby shits its diapers, do you care about the amount of shit it spreads?
no
@VermillionAzure functions are either pure or impure; preferably pure. It's that simple
what a nice parallel, function purity and clean diapers
@thecoshman But it also matters whether your program actually throws an exception or keeps on running or runs into certain walls
09:16
> This function has been ranked 68% pure.
exceptions are outside the definition of purity
@AnastasiyaAsadullayeva if that goes on the elephant level.. well.. I might suspect something is wrong
Paper title: "Unlike your mom, purity is measurable."
4
Tonight in Ask Cinch: Can a pure function throw (up)??
In which unit do you measure a mom?
09:17
Nothing, it's not measurable
Suppose I have a function that implements bitwise division between two bytes.
@AnastasiyaAsadullayeva ...well, if it always throws for a given input...
@AnastasiyaAsadullayeva that's a puke function
@VermillionAzure if a function throws an exception, due to inputs, that's still part of it's purity, if it's throwing exceptions because of shit that is outside of the control of normality (OOM for example) it mattesr not.
09:18
@MarcoA. lol
@Morwenn cpm
@thecoshman Well, malloc isn't really pure.
@thecoshman But it would be useful to enumerate the cases in which we run out of memory and then measure which parts of the program are affected given that happens.
@VermillionAzure what for and no
malloc is not pure at all D:
09:18
@VermillionAzure wat
this lounge shall be cast back into the fiery chasm from whence it came from, at December the 1st.
@VermillionAzure any function can throw exceptions
@VermillionAzure you mean every part
@thecoshman ...except noexcept ones.
@Griwes well... it is...
09:19
if you run out of memory no allocation will succeed
so if you want to enumerate that, enumerate all allocations
@Griwes except no
no idea how the hell is that even remotely useful
@BartekBanachewicz It's not good to just assume that if something goes wrong, everything deserves no observation and should be considered invalid
@thecoshman No - malloc(1) doesn't always return the same pointer.
I thought one of Erlang's positives is that crashes are isolated?
09:19
@Griwes oh true, didn't think about it that way :P
And they are propagated up an error chain?
@VermillionAzure except running out of memory isn't "something going wrong" in the traditional sense
I can't handle this any ore
@Griwes even malloc(0)
@VermillionAzure that's because erlang spawns physical processes and uses heavy messaging for program parts
09:20
@thecoshman But even if you consider a pointer value an implementation detail, not its actual value, then it can either return an object... or NULL. For the same arguments.
it's like trying to reason with a toddler about using his wood blocks to build the Arc de Triumph
2
@VermillionAzure how did we end up with erlang now
Well, if I can continue
Suppose we have divison between two unsigned bytes
you'll be allowed if you intent to start making sense
Xeo
Xeo
09:21
@LucDanton Thanks, I'll take a look at it
in C++, it's an error to divide by 0. NaN, etc.
Throws an exception, if not catched, end of application or whatever. Bad idea.
> in C++
> divide by 0 throws an exception
I doubt it throws an exception
talk sanctuary in IRC people
more like "or whatever"
09:22
@VermillionAzure No. It's not "in C++" and it's not "an error" - that operation is just undefined.
@AndyProwl imagine that in the standard instead of "undefined"
@BartekBanachewicz to me the Standard makes so much sense that "or whatever" would fit fine at the end of most sentences
exaggeration, but I get that feeling quite often
09:24
¬_¬ IRC is also free from onebox eating up your entire screen
Note that a [[pure]] function shouldn't throw anything.
@AnastasiyaAsadullayeva pokemon!
@Morwenn Not true.
@Morwenn no, it can be part of the output
If it always throws for a subset of its arguments it's still pure.
09:25
akin to self-immolation, or whatever
@Griwes I am reading the paper, so yes, it's true.
Exceptions are kind of like a second channel to return values.
@Griwes Doesn't matter.
@LucDanton right
int purfunction(int noCare){ throw new trollException();}
09:26
They are monadic.
The point is that 0 should be an invalid input
I'm not talking about purity in general, but about the proposed [[pure]] attribute :o
Normally, we would put a guard to such a thing and then perhaps throw an exception if we do get it
@VermillionAzure Does matter - you are trying to be overly pedantic about some bullshits, so so am I.
Pedantry master race
09:26
@VermillionAzure what
@Morwenn ...is someone confusing purity and noexcept?
thor new exception()
I like it
@Morwenn well why didn't you say so!
@Morwenn Also what, is there really a proposal for [[pure]] that says "no exceptions"?
@BartekBanachewicz 3 / 0, where 0 should be invalid
09:27
o.O
C++ for coshmen
@thecoshman Because I wouldn't have used the attribute syntax otherwise.
wow, things are getting out of control: techcrunch.com/2013/03/21/…
@VermillionAzure it depends on the codomain of / you want to take into account
09:28
@Morwenn but you always use messed up punctuation
@BartekBanachewicz Let's just consider 0 as "invalid" or "incorrect" because it'll crash the program.
@ʎǝɹɟɟɟǝſ I don't use C++ much at all
@thecoshman Nope.
How do we guard against a divide by 0 error in C++?
haven't for months
09:28
We have a few options
> In contrast, a function that is not well-behaved is said to be ill-behaved or, equivalently, impure.
An ill-behaved function may violate the above strictures via such behaviors as:
• throwing an exception without catching it,
I know exactly which punctuation I'm using. I'm not messing up things.
WHAT A BUNCH OF FUCKING MORONS
UGH
1. Check outside the function for invalid inputs
@Morwenn no, just messing things up.
09:29
@VermillionAzure why should I lean in to your assumptions?
@thecoshman Nope.
This requires an "extra step" and further increases the complexity of the program
> A free function or a member function is described as well-behaved or, equivalently, as pure if it:
1. communicates with client code solely via the function’s argument list and return value, and
@VermillionAzure can you like program at all?
WHAT. A. BUNCH. OF. FUCKING. MORONS.
09:29
@BartekBanachewicz I'm just trying out ideas; please don't hurt me QQ
@VermillionAzure why do you have to try them out in a series of barely related one-liners?
@Griwes and WHAT!!! How can I carry on with life?
@Griwes What's the problem?
Write your idea in a gist so people who want can read it whole
@thecoshman The only thing that's messed up is your brain when I use French punctuation because I find the Engish one ugly. And you totally understand what it means, which is kind of the purpose of writing to begin with.
09:30
it's also called a blog post sometimes
@ʎǝɹɟɟɟǝſ They disregard exceptions as a part of return value.
then we can bash it in comments
UGH.
@BartekBanachewicz He is writing a new tutorial chapter.
what tutorial
09:30
So he has to write it here, see what we can fix for him and the write it down as a whole
It normally depends on your setting (type theory and all that), but it’s the usual definition. It boils down to what x : T should mean, because that has a consequence on the semantics of f a : T. E.g. in a strict, total setting then exceptions are ruled out.
good bye lounge. got to hand off my hardware in a few mins. see you on the next job :-)
@ʎǝɹɟɟɟǝſ he can't program for shit and he's writing tutorial? Sounds like most of the C++ books alright
@ArneMertz ooh good luck mate
@BartekBanachewicz ty
@BartekBanachewicz He is Cinch. Rings a bell?
09:31
This is what follows from people not seeing that exceptions and monads are isomorphic :/
@ArneMertz did lounging get you fired? :(
@ArneMertz cheers & good luck
$ git emrgeool
git: 'emrgeool' is not a git command. See 'git --help'.

Did you mean this?
        mergetool
friday evening
@ʎǝɹɟɟɟǝſ I thought we told him like a million times already to stop bouncing his incompetence off off our backs
friday morning
09:31
@melak47 nay. I quit. Embarcadero no more \o/
@BartekBanachewicz Sehe and few others keep helping him, so why would he ever stop?
@Griwes last time we had this discussion jeff plonked me and robot talked for two hours
@Morwenn those double chevrons are wrong and you know it
I'm stress free now though
Pretty far away from plonking anybody
No more MySQL, no more PHP for the rest of my life
09:33
@thecoshman They are right in their own paradigm, which is the one I happen to use.
@Morwenn it's wrong and you know it
@Griwes That doesn't make them "fucking morons" though. Maybe they consider purity as "being akin to a mathematical function", which cannot fail. I see what you mean and probably agree with your viewpoint but I wouldn't be that sharp
Mongolia, UTC+6
@AndyProwl shut up you andygnorant
@thecoshman You know you're just being a useless arrogant pedantic prick ^_^
@Morwenn Like all Brits
09:35
@Morwenn yes, but you are still wrong
@AnastasiyaAsadullayeva eh?
>>> x = 20
>>> for x in ('one', 'two', 'three'):
...     pass
...
>>> x
'three'
2
what is scoping
@thecoshman Seriously, we'll discuss this again the day you start your sentences with capital letters and end them with an actual dot. Until there, you have no right to talk punctuation.
@AndyProwl Exception is also a kind of a return value.
@Rapptz lol
09:36
mbind on Maybe monad is also "akin to a mathematical function".
@Rapptz dunno, seemed pretty clear that it's the same x to me
How about mlady
the fact it's a dirty savage weakly typed code where a name can change it's value during the execution is another thing
@Griwes And it is not incompatible with the usual definition of purity. Where is the problem?
@Griwes Depends how you see it. The way I see it they are not, because a "return value" implies success for me.
09:37
Even PHP gets scoping right
@BartekBanachewicz eh kinda surprised
@AndyProwl cough Either
for loops have their own scopes
@Rapptz who said so?
@AndyProwl If a function always throws an exception for a given argument, that function doesn't stop being pure due to that.
Mathematically.
But as usually, C++ will reinvent the mathematical terms
09:38
@Morwenn i Will differ! on /this/ matter, LADDYYYY!!!!?
slap the usual name on it
@BartekBanachewicz Clearly not Python
and then claim that it invented it.
@Rapptz (one of the key benefits of the raw for loop is the ability to save the last-used index for me. That's one of the reasons I have for using fors in 2015 actually)
@BartekBanachewicz Yes, you can interpret the return value as an error information, but the function has succeeded
@Griwes but mathematical functions don't throw
09:39
@AndyProwl in some languages the functions can't fail
@BartekBanachewicz You can still do that even with proper scoping
1 min ago, by Bartek Banachewicz
@AndyProwl cough Either
49 secs ago, by Andy Prowl
@BartekBanachewicz Yes, you can interpret the return value as an error information, but the function has succeeded
1 min ago, by Bartek Banachewicz
@AndyProwl in some languages the functions can't fail
hint: every-language-ever
Don't do that "hint: x" thingy
@Rapptz note how you explicitly put a type to the 2nd x. It's moot
@Rapptz I've encountered a similar error in C.
@ʎǝɹɟɟɟǝſ I didn't understand this very much /cc @Bartek. I mean, I understand the statement of course, but not its relevance as an objection to my comment
09:42
Hi @Bartek how are you
@AndyProwl Haskell has "mathematical" function which express errors as return types and still can't fail/always succeed
@ʎǝɹɟɟɟǝſ Haskell isn't one of those languages. Agda is.
for does not have a seperate scope in python
Haskell also has exceptions, but that's something we don't talk about
@ʎǝɹɟɟɟǝſ I'm afraid I'll get Cinchy if I try explaining how I see things
09:42
@ʎǝɹɟɟɟǝſ hehe
@bluefog Yeah, we got that far, thanks
@bluefog Thanks meitantei.
@AnastasiyaAsadullayeva I'm fine. New job. New colleagues. Stuff
so I guess this is not unique here
@BartekBanachewicz How is it, when did you start?
09:43
@AndyProwl You can't get "cinchy" unless you have your own website with your own tutorial "under construction"
hehe ruby hehe
2
Unless you meant kinky. In that case, please, go on.
@AnastasiyaAsadullayeva 1st Sep. It's pretty cool, I'm doing R&D on Node.js code. Fun stuff. Trick-ish.
And a lot of people get to work on motorbikes :3
Xeo
Xeo
@Rapptz it's stupid-scoping
Someone drove a totally beautiful Africa Twin here today. I nearly drooled
09:44
@BartekBanachewicz What's R&D on Node.js? What's the most efficient way of not using it? (More seriously what is it)
Yeah, I don't like it either.
@BartekBanachewicz rip
Makes no sense to me as default
but basically the way I see it is that, at least in C++, producing a return value should mean success, and producing an exception should mean failure. You can encode a failure in a return value, but that's a user thing
I'm not sure I can explain it with the right words damn
@Bartek have you seen the V8 "hello world"?
09:45
@AnastasiyaAsadullayeva less seriously loool, JS
> In the old days, when Microsoft first invented C, the syntax for calling functions involved more parentheses; this was after their market research indicated that most C programmers would be coming from a Lisp environment. Later, when Kernighan took over the language design (right after AT&T bought Microsoft's language technology), he decided to eliminate the parentheses, but the old form is still allowed.
wut
@AnastasiyaAsadullayeva well, my company does perf monitoring and we're basically hacking stuff in order to measure it, in short
is this a joke
it's on a higher level or something (Cinching here)
@AndyProwl success/failure is irrelevant when discussing purity :/
09:45
@Mr.kbok lol
source?
@thecoshman I'm pretty sure my 1000-line js codebase is much less pain to work with than your 20-year java codebase
@Griwes I'm writing mostly Javascript, not native code.
@BartekBanachewicz vOv It's still a code base
yeah definite satire
09:46
> Microsoft
> invent
lol
@thecoshman yes it's almost like they differed
@BartekBanachewicz lol monitoring NodeJS performance, there's only one level: abysmal. easy.
@Griwes depends what you mean by "purity", whether it's just "not having side-effects" or "behaving like a mathematical function". In the former case then yes, it's irrelevant, but I'm not super-offended by the latter interpretation either
Xeo
Xeo
> 1.3: If I write the code int i, j; can I assume that (&i + 1) == &j?

Only sometimes. It's not portable, because in EBCDIC, i and j are not adjacent.
@BartekBanachewicz ...the not even 2yo js codebase I'm working with these days is much more pain to work with than the 10yo C++ codebase I've been working on before.
Xeo
Xeo
09:47
hahaha
this is good
@AnastasiyaAsadullayeva doesn't prevent me from having fun. Hint: not a single person on node.js team likes node.js here
Did I mention that the old one is partially generated from IBM Rational Rhapsody?
@AndyProwl returning an error code or throwing an exception is, as far as purity is concerned, the same thing.
@BartekBanachewicz I was just riding on the NodeJS hate train
like all the cool kids
@AnastasiyaAsadullayeva we're basically doing the "choo choo"
09:48
@AndyProwl Again: exceptions are isomorphic to monads (like C++'s proposed expected).
but the job is still fun
@thecoshman Eh
@thecoshman I don't want to reply to your message with the message you're replying to, but well it does depend on how you define "purity"
purity is not so much about the lack of side effects, but that if you have a certain set inputs, you know exactly what the return value would, to the point that if you just cached it, there'd be no difference.
Xeo
Xeo
> 1.8: What's the auto keyword good for?

Declaring vehicles.
09:48
@Griwes Sure, I get that part. We've discussed it (at Uncon I think)
Xeo
Xeo
Thanks @Mr.kbok, this is great
@Rapptz lol, it's just jokes. I'm not fully awaken yet -_-
lol
@AndyProwl sure, but then everything depends on how you define things, you lovely guy you
19.15: What is the most efficient way to count the number of bits which are set in a value?

Start a counter at zero and add one to it for each bit set. Some operating systems may provide a call to do this. For values over INT_MAX/2, start the counter at CHAR_BIT * sizeof(int) and subtract one for each bit not set.
Xeo
Xeo
09:49
> This works because, in C, declaration reflects use, but it's one of those weird distorted mirrors.
@AndyProwl And here, multiple times already. :P
@thecoshman Yes, what I'm saying is that defining purity as "behaving like a mathematical function" does not sound super-outrageous to me
lmao this one's great
> 19.10: Where can I get copies of all these public-domain programs?

From ftp://ftp.microsoft.com/ . Some of the code may look copyrighted; don't worry! The small companies that wrote it in the first place are not available for comment.
what are you guys quoting
@AndyProwl Can't remember if I pinged you already, but my open content part of the talk is right after the talk itself.
@Griwes What's open content?
@AndyProwl ah, so you think that throwing exceptions would make a function not 'pure like a mathematical function'
@thecoshman Yes, because I see exceptions as a way of reporting errors, and mathematical functions don't fail
@AndyProwl it's the part after the sessions where random stuff can be discussed
everything on that page is pretty good
> 19.9: Is C++ a superset of C? Can I use a C++ compiler to compile C code?

C++ is a superset of something, we're not sure what. You can use a C++ compiler to compile C code, but the results may surprise you.
09:51
I basically booked myself a room to conduct the, err, "second hour" of the talk.
C++ is full of something, alright.
> 2.8: Why does sizeof report a larger size than I expect for a structure type, as if there was padding at the end?

Because there's padding at the end. **Duh**.
@Griwes oh I'll be there then, unless it conflicts with some other talk I really want to attend. But anyway I think we can get to some discussion even offline right
Mathematical functions have a specified domain.
you don't have to quote the whole thing here
09:52
@AndyProwl yeah
we can read it just fine
@AndyProwl f(x){ return 10/x } <== how does maths handle f(0) it simple doesn't, it makes no sense. Same as with code, except with code we allow us to handle that error cases and 'return' something
@thecoshman the function is not defined mathematically. It doesn't "error" when you try to evaluate it
there is no "trying to evaluate it" either
It's just nonsense. Errors are not bugs
@AndyProwl that sounds like a cop out to me
Xeo
Xeo
> No. The '0' of '0;' is not evaluated as an instruction, rather, it is just ignored. The only reason to use '0;' instead of ';' is to help keep 1-heavy code properly balanced (in C, which uses binary representations for numbers, it is possible for code to become unbalanced; an unbalanced binary tree is a common source of poor performance.
hahahaha
09:54
Well it is a null statement after all.
inb4 C code.
@thecoshman 0 is not part of the domain of the function
it can be if your codomain is R + inf
auto f(int_except<0> x) { return 10/x; }
shitty. use a dependent constraint
09:55
@thecoshman Perhaps Jeff phrased it better
auto f (int{value_not(0)} x)
@ʎǝɹɟɟɟǝſ ok, fine. So you are saying f(x) is well defined all but one value of x. Why can't I do the same for my code? for all values of x, except one, I have a well defined mathematically pure function. There's just one value, x=0 where I have to handle it sepcially... never call f(0)? or just handle it specially by return an exception opposed to an number.
@BartekBanachewicz No
@BartekBanachewicz No. You would a limit for that
lim (x -> 0-) of (f(x))
i am pretty sure division of a rational number by 0 is defined to be infinity (or minus infinity)
09:57
Nope
We do not take $1/0$ as $\infty$, or as $-\infty$. Division by zero is undefined.Arturo Magidin Apr 2 '12 at 20:19
In mathematics, division by zero is division where the divisor (denominator) is zero. Such a division can be formally expressed as a/0 where a is the dividend (numerator). In ordinary arithmetic, the expression has no meaning, as there is no number which, multiplied by 0, gives a (assuming a≠0), and so division by zero is undefined. Since any number multiplied by zero is zero, the expression 0/0 also has no defined value and is called an indeterminate form. Historically, one of the earliest recorded references to the mathematical impossibility of assigning a value to a/0 is contained in George...
@BartekBanachewicz mathematically or C++?
65
A: I have learned that 1/0 is infinity, why isn't it minus infinity?

Ethan BrownThe other comments are correct: 1/0 is undefined. Similarly, the limit of 1/x as x approaches 0 is also undefined. However, if you take the limit of 1/x as x approaches zero from the left or from the right, you get negative and positive infinity respectively.

(I think that's not the case either in maths nor C++ tbh)
09:57
@AndyProwl in C++, iow in that number format that I can't recall, it's NAN
k, you're right
@thecoshman no, in C++ it's UB
in maths it's just not defined
@thecoshman IEEE754 can represent infinity
and the domain if R - {0}
09:58
@BartekBanachewicz Who the fuck are you and what did you do with our bartek?
@AndyProwl I thought C++ differed the value to what the float format handles it as... oh well
@ʎǝɹɟɟɟǝſ lol
I hope he is ok you little bitch
@BartekBanachewicz It's defined to be whatever you want.
09:59
@R.MartinhoFernandes catfish?
In usual arithmetic, it's just not a thing.

« first day (1791 days earlier)      last day (3383 days later) »