« first day (1835 days earlier)      last day (3091 days later) » 
00:00 - 20:0020:00 - 00:00

8:00 PM
@Cerberus for all numbers.
(if they're chosen to be floating point)
maybe this will help (or confuse things even more). Suppose you only have 8 bits to represent numbers.
 
@Cerberus yeah
 
You could say they mean 0 to 255
What if you want to do math on numbers beyond 255?
or bewtween 0 and 1
or negative.
 
You just have to think like an engineer. 2 + 2 = 5, for large values of 2.
 
so you choose (arbitraily) 1 bit to be sign (+/-), 3 bits for exponent, 4 bits for significant digits.
let a = 1-101-1111 = -15 x 2^5 = -480
 
There's also the problem that most PCs do not have ECC memory. From time to time a cosmic ray changes 2 to some other value, maybe 0 or 16384.
And you don't know.
 
8:07 PM
let b = 0-001-1001 = 9 x 2^2 = 18
we know externally that a+b = -462
but within the floating point system we have:
... hmm I'm hoping this works out...
1-101-1111? maybe 1-101-1110 with rounding?
I can't remember the addition formula...it's complicated so I'm guessing that there's just not enough room to fit 18. The next number bigger from =480 is -480 + 32 (the value of the exponent) = -448, you can't get values in between.
oops I made a mistake (that doesn't matter): b = 9 x 2^_1_
 
@Mitch Okay, but why choose to represent 1 as a floating point, then?
@JohanLarsson Haha wait, so globals are like snails that slow down your face?
 
sure, you can choose your numbers to be of integer type, and one often does, but you can hardly ever do division.
 
@Cerberus an appropriate response in a code review no?
 
@Mitch Ah okay, so each number is represented as a formula...
@MετάEd I thought ECC had finally become cheap enough for home users?
 
yeah, pretty much (integers aren't)
 
8:19 PM
@Mitch You could automatically convert them into integers if they contain no decimals?
 
numerical computation is its own dark art. you'd think computing the distance between two points is as easy as #\sqrt{dx^2 + dy^2}$, but it's not.
 
@JohanLarsson Mmm quite possible! You what you are talking about is that globals are active all the time and so require lots of checking throughout the code, as opposed to local ones?
 
@Cerberus you could, and different programming languages assume different things when doing type conversion (converting from floating point to integer, or the other way)
 
OK.
 
@Cerberus The thing is, an integer is a precise number. A floating-point number is an imprecise number. Converting an FP that you think has no "decimals" to an int is just guessing.
It's like the difference between 1,000,000 and 1x10^6
 
8:24 PM
If all digits beyond the dot all say 0?
 
The first has 7 significant digits, the latter has 1
it's not kosher to just equate them.
 
Well, depends on what you're doing.
 
In this case, we're doing math in a computer.
 
Are we.
 
or engineering work.
 
8:25 PM
I thought I was chatting.
I suppose I see your point that it could matter in some cases.
 
an integer in a computer is all significant digits.
 
But not in ordinary Javascript pages.
 
javascript is built using computers.
 
@Cerberus i was ruminating.
swallows
 
it has different numerical types that are related to what's under the hood.
 
8:26 PM
How bovine of you.
 
@Cerberus how daring of you.
 
But apparently the standard kind of Javascript notes 1 as 1.00000000000ish?
 
Some programming languages do try to hide the representation. But invariably they have problems, or they are slower.
@Cerberus no.
 
@Mitch I'm not doing anything!
 
you dared call me a cow... Dog.
 
8:27 PM
!!
You you...seahorse!
 
@Cerberus oh wait, yes. JS uses FP throughout.
 
@Mr.ShinyandNew安宇 no ints at all?
 
If anything, that would seem to slow it down for integers.
Like 1.
BRB
 
floating point is pretty fast... well, that's exactly it, the floating pt format and implementations are expected to take a small finite # of cycles, just like ints.
 
@Mitch according to MDN and MSDN it uses double-precision FP
@Cerberus well, not necessarily.
if all you have is FP, you can still represent integers.
but the point is that certain numbers cannot be easily represented and error creeps in.
Also, it's not easy to change how a language represents its numbers later.
So if JS were being invented today, it might not use FP, it might use something else that specifies a certain amount of precision much higher than what FP provides, and it would hide those details in the language spec and implementation.
But you can't go and just change all of that now... it'd break too many things.
 
8:44 PM
@Mitch That is also what I expected, which is why I expected a far larger number of decimals to be practicable.
@Mr.ShinyandNew安宇 OK that makes more sense, so part of is because of considerations that are no longer current.
 
@Cerberus Non ECC memory has never made sense to me. If I ever buy a home PC it will have ECC regardless of the additional cost.
 
It has always seemed...attractive to me.
Look how cheap!
Or am I missing something?
Is 1600MHz too slow?
 
@Cerberus Only part of it. JS is increasingly used in high-performance situations and so good math performance is critical and so it's increasingly being accelerated using the GPU and other things. So having all numbers be represented by a hardware type is very very useful.
It's not clear that increased precision is worth the cost.
 
user174558
It seems the commotion is over, good.
 
user174558
9:04 PM
Will there be mod elections soon?
 
do we need elections?
 
yeah, we should just pick mods at random ;)
 
user174558
Someone was asking about elections on meta.
 
we have 8 mods. I don't know how many are active though.
 
@Mr.ShinyandNew安宇 You mean, represented by the same type?
 
user174558
9:10 PM
222
A: Are there real-life relations which are symmetric and reflexive but not transitive?

amWhy $\quad\quad x\;$ has slept with $\;y$ ${}{}{}{}{}$

 
user174558
When a wrong answer has 222 upvotes, this site is finished. QED.
 
@Cerberus No, I mean having numbers represented by a type that requires no further manipulation before the processor can do math with them.
that is, fixed-point integers and ieee floating point numbers.
 
The further manipulation being removing all the zeroes if there are only zeroes?
 
any other representation may be great for accuracy but would be terrible for performance.
You can't just remove zeroes.
 
You could just do it, in JS...
 
9:12 PM
It's not mathematically sound.
 
removes nothing, finds something
 
But does that really matter for normal web pages?
 
JS isn't just for "normal web pages"
 
what is normal?
 
And it can represent 1 as 1.
so stop worrying.
 
9:13 PM
You could have a special mode where you don't do the conversion, for special pages.
phew
 
@Cerberus having special modes just makes life harder, not easier.
 
I don't know.
 
user174558
@RegDwigнt If nobody is under no obligation, that means everyone is under some obligation. QED.
 
@Cerberus it sounds very complicated to me. for a start, what number system would you use in place of IEEE?
 
Uhh I have no idea how IEEE works.
 
user174558
9:20 PM
IEEE just means aiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
that's less important than how the number system that doesn't have rounding errors would work
there are plenty to choose from
we could create CerberuScript in javascript, that is the same as JS, expect for numbers :D
 
user174558
I am going to eat.
 
@MattE.Эллен I know nothing about this, but the first idea that popped up was simply to convert between integer and floating point when necessary, i.e. when you get a floating point that has only zeroes behind the dot, you convert it into an integer.
 
@Cerberus JS does that, at least in representation
 
But internally, I imagine it takes more time if it does keep the zeroes.
 
9:31 PM
more time to what?
 
user174558
More time to spend with Mario.
 
It would take more time to execute calculations.
 
because all numbers have a fixed number of bits (in JS) all operation take the same amount of time
I think they have a fixed number of bits
 
user174558
I have a big problem with Firefox.
 
that's how it normally works
 
9:36 PM
Okay, so that would have to change, their all having the same number of bits.
 
user174558
Since the last version or so, it keeps asking me to download Firefox for Android or iOS. It keeps popping up, again and again. Is it spyware?
 
@Mr.ShinyandNew安宇 I mostly use the "Block JS" option. So precision is not such a big deal to me.
 
Of course I imagine that will be impossible to change in practice.
 
@Cerberus Why do you want to change how many bits are used to represent the numbers?
 
@MετάEd I didn't know JS worked with blocks.
 
user174558
9:37 PM
@MετάEd I did not get what you meant by mixing up your parrot.
 
@Mr.ShinyandNew安宇 Well, because it would seem to take less time for a computer to multiply 1 by 1 rather than 1.0000000000000 by 1.000000000000?
 
@Cerberus But you'd need to build a different circuit for that.
And you'd need some oracle to know when your 1.00000000 is a precise 1 or a fuzzy 1.0000000
 
You could discard that distinction for daily tasks.
For special tasks, like maybe engineering, you're use a special mode that doesn't convert things (although I doubt whether JS would be appropriate for that anyway).
 
I'm not sure what you're trying to achieve....
 
Never mind.
I was just critically questioning something that seemed odd.
 
9:40 PM
let's say you compute something and the result is 1.000000
let's say you have the option of storing it as 1 using a different underlying hardware type.
how much do you save in 1. checking that the value can be converted, 2. converting it, and 3. doing further math using a possibly faster circuit?
or you can just leave it as 1.0 and do the math using your other math circuit.
 
What is a "hardware type"?
@Mr.ShinyandNew安宇 Yes, that is the question.
@Mr.ShinyandNew安宇 Why 1.0 and not 1.000000?
 
@Cerberus one of the kinds of number the CPU natively understands.
 
OK.
 
@Cerberus I was lazy, didn't want to type out those zeroes
 
Tsk.
 
9:46 PM
@Cerberus I'm sure you wouldn't save anything.
 
@Mr.ShinyandNew安宇 Which no doubt includes integers and floating points?
 
it'd probably be very costly.
 
Okay, that is possible.
 
@Cerberus yes, it includes only those two types.
(with different sizes possible)
one of the most expensive things to do in a processor is branch
 
Sizes, as in numbers of bits per number?
 
9:47 PM
yes
but converting between one size and another takes cpu cycles
 
Understandably so.
 
there's fundamentally no performance difference between adding 16 bit numbers or adding 64-bit numbers. But there is a cost in trying to examine an FP and see if it can be converted to an int... that's a test and a branch. The test itself probably requires doing an addition.
 
Well, then I guess we have to stay with all those 1.0000000s...
Yes, I got your point.
I have to run now. Don't make a mess!
disappears in a puff of smoke
@MassimoOrtolano That's a great surname!
But I have to go.
 
user174558
Buongiorno @MassimoOrtolano!
 
Bai all.
 
9:55 PM
CU
 
user174558
It is 6 AM, time to eat now, LOL.
 
@Cerberus: Hi Cerberus! Actually more known in its plural form, thank to Riz :-)
Buongiorno @JasperLoy, but buona notte for me: it's 11 pm here.
Funny to see a discussion about floating point numbers in the English.SE chat :-)
 
10:31 PM
@MassimoOrtolano You can find discussions about pretty much any subject under the sun and many above it here.
One of my first experiences with this chat room involved people posting images of the perfect espresso.
 
@JasperLoy Oh. Not it, the parrot. It, the avatar.
 
11:13 PM
@Cerberus Be sure to get the LEGO edition if your blocks have little studs.
 
00:00 - 20:0020:00 - 00:00

« first day (1835 days earlier)      last day (3091 days later) »