Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Bongo Bill
Jan 17, 2012

IEEE floating point numbers can be used to represent real or imaginary values.

Adbot
ADBOT LOVES YOU

Ranzear
Jul 25, 2013

Reminder that all "non-complex" numbers just have a zeroed i coefficient and the statement wasn't about representation anyway.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Hammerite posted:

if by "number" you mean real or complex numbers then -0 is just another way of writing 0 so that is not "some other number"

if by "number" you mean some flavour of IEEE floating point then -0.0 and 0.0 are indeed different on some level but then QuarkJets's original claim, that "every number is the square of some other number" is false, because -1.0 is not the square of any number!

But to provide slightly less pedantic content for the thread:

code:
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 1.0 / 0.0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: float division by zero
>>>
what's with this? Shouldn't I get infinity as a result and not an exception? I thought Python floats were IEEE double-precision. Aren't they breaking the rules here?

i * i = -1

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Bongo Bill posted:

IEEE floating point numbers can be used to represent real or imaginary values.

What's the IEEE floating point number (single or double precision, your choice) that represents the imaginary unit? What is its bit pattern?

What's the IEEE floating point number (single or double precision, your choice) that represents the number 1 + i (where i is the imaginary unit)? What is its bit pattern?

Ranzear posted:

Reminder that all "non-complex" numbers just have a zeroed i coefficient and the statement wasn't about representation anyway.

could you clarify who you are addressing here, as I have no idea whether this post is directed at me or at someone else.

leper khan posted:

i * i = -1

Another person who is either trolling me or cannot read

The post you quoted alludes to the existence of complex numbers (in the first paragraph), so you cannot possibly have read and understood the post and come away from it with the sincere belief that I am unaware of the concept of complex numbers.

CPColin
Sep 9, 2003

Big ol' smile.
Shut up, nerd

Bongo Bill
Jan 17, 2012

Hammerite posted:

What's the IEEE floating point number (single or double precision, your choice) that represents the imaginary unit? What is its bit pattern?

What's the IEEE floating point number (single or double precision, your choice) that represents the number 1 + i (where i is the imaginary unit)? What is its bit pattern?

Any bit pattern that can be used to represent the coefficient of the real component can also be used to represent the coefficient of the imaginary component, but I admit you'd need two of them to represent a complex number.

Nobody thinks you don't know about imaginary numbers, since it was obviously a simple communication error whose correct meaning is easily determined, but the more you double down on it, the more fun it is to push back.

Bongo Bill
Jan 17, 2012

https://twitter.com/dasharez0ne/status/917420823639498752

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Bongo Bill posted:

Any bit pattern that can be used to represent the coefficient of the real component can also be used to represent the coefficient of the imaginary component, but I admit you'd need two of them to represent a complex number.

Nobody thinks you don't know about imaginary numbers, since it was obviously a simple communication error whose correct meaning is easily determined, but the more you double down on it, the more fun it is to push back.

So you would agree that the IEEE floating point number "-1.0" is not the square of any other IEEE floating point number?

Bongo Bill
Jan 17, 2012

Jabor posted:

So you would agree that the IEEE floating point number "-1.0" is not the square of any other IEEE floating point number?

You've got me there. You can use an IEEE floating point number to represent the number that the IEEE floating point number "-1.0" but you shouldn't.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Some floating point numbers are not the square of any other floating point number. Why is that important again?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

ultrafilter posted:

Some floating point numbers are not the square of any other floating point number. Why is that important again?

I have no idea, but when Hammerite said it a couple of people tried to jump in with some inane (and irrelevant) complex numbers sidetrack for some reason.

CPColin
Sep 9, 2003

Big ol' smile.
Perhaps the real numbers were the squares inside us all along

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I can't believe that someone would call me, a person who posts too much in the "complain about other people's programming" thread in the computer programming forum on noted non-nerdy website Something Awful, a nerd and tell me to shut up

QuarkJets
Sep 8, 2008

Jigsaw posted:

It is if you use the power of imagination!

This post owns fyi

QuarkJets
Sep 8, 2008

Jabor posted:

I have no idea, but when Hammerite said it a couple of people tried to jump in with some inane (and irrelevant) complex numbers sidetrack for some reason.

The original post was implicitly referring to complex numbers and wasn't about IEEE floating point at all

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

QuarkJets posted:

The original post was implicitly referring to complex numbers and wasn't about IEEE floating point at all

Hammerite posted:

if by "number" you mean some flavour of IEEE floating point then -0.0 and 0.0 are indeed different on some level but then QuarkJets's original claim, that "every number is the square of some other number" is false, because -1.0 is not the square of any number!

That reads as pretty clearly being about IEEE floating point to me.

Bongo Bill
Jan 17, 2012

Well, yes, but it was preceded by

QuarkJets posted:

Every number is the square of some other number

which was a joke to begin with.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

QuarkJets posted:

The original post was implicitly referring to complex numbers and wasn't about IEEE floating point at all

Yeah, your original post was implicitly about complex numbers. It was pokeyman's post that brought up negative zero (jokingly), and that's the post I chose to reply to pedantically

I thought I was being pretty clear and explicit about which of my uses of the word "number" were references to what might be termed the numbers of ordinary arithmetic (integers, real numbers and complex numbers) and which were references to IEEE floating-point numbers. Which is why I was so confused that what several people took away from my post was that I don't even know what complex numbers are.

CPColin
Sep 9, 2003

Big ol' smile.

Hammerite posted:

I can't believe that someone would call me, a person who posts too much in the "complain about other people's programming" thread in the computer programming forum on noted non-nerdy website Something Awful, a nerd and tell me to shut up

We get it, you have difficulty imagining things

QuarkJets
Sep 8, 2008

Hammerite posted:

Yeah, your original post was implicitly about complex numbers. It was pokeyman's post that brought up negative zero (jokingly), and that's the post I chose to reply to pedantically

I thought I was being pretty clear and explicit about which of my uses of the word "number" were references to what might be termed the numbers of ordinary arithmetic (integers, real numbers and complex numbers) and which were references to IEEE floating-point numbers. Which is why I was so confused that what several people took away from my post was that I don't even know what complex numbers are.

You've accomplished your goal of writing annoying pedantic posts, well done

Jeb Bush 2012
Apr 4, 2007

A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.
hammerite's post made perfect sense if you read what it was replying to, these attempted dunks are dumb as hell

NtotheTC
Dec 31, 2007


all numbers are imaginary imo

cheetah7071
Oct 20, 2010

honk honk
College Slice

Jeb Bush 2012 posted:

hammerite's post made perfect sense if you read what it was replying to, these attempted dunks are dumb as hell

Volte
Oct 4, 2004

woosh woosh
Complex numbers aren't real numbers.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

CPColin posted:

We get it, you have difficulty imagining things

Ok, this one was actually funny

Doom Mathematic
Sep 2, 2008
0.0i * 0.0i = -0.0

Karate Bastard
Jul 31, 2007

Soiled Meat
Which easy framework was it that I could gather all my technical debt into? Because it honestly seems like a p attractive idea at this point

QuarkJets
Sep 8, 2008

SonarQube has pretty reasonable rules for assessing Technical Debt

Karate Bastard
Jul 31, 2007

Soiled Meat
I mean as in the thread title

DoctorTristan
Mar 11, 2006

I would look up into your lifeless eyes and wave, like this. Can you and your associates arrange that for me, Mr. Morden?
Run everything on containers, now everything’s a docker problem

normal contact
Mar 19, 2010

Just had my first case of "who the gently caress wrote this garbage - oh it was me". Am I a real programmer now?

Macichne Leainig
Jul 26, 2012

by VG
No. Real programmers are a myth perpetrated by Big Recruiter

QuarkJets
Sep 8, 2008

normal contact posted:

Just had my first case of "who the gently caress wrote this garbage - oh it was me". Am I a real programmer now?

You’re a complex programmer now

Spatial
Nov 15, 2007

Computer programs consist of real part which is godawful, and an imaginary part which is awesome.

Absurd Alhazred
Mar 27, 2010

by Athanatos

Spatial posted:

Computer programs consist of real part which is godawful, and an imaginary part which is nightmarish.
ftfy

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin
I'm gonna go and become a mathematician so I can create a whole new class of numbers and call them "pedantic" numbers, just so these conversations will be even more incomprehensible.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug

normal contact posted:

Just had my first case of "who the gently caress wrote this garbage - oh it was me". Am I a real programmer now?

I just had my first case of "Falcon2001 from four months ago wrote this and decided it didn't need test cases written, and now I want him tried for war crimes against the future" when I had a deadline move up suddenly and all of my code is suddenly not as inherently trustworthy as I felt it was four months ago.

Ranzear
Jul 25, 2013

Dr. Arbitrary posted:

I'm gonna go and become a mathematician so I can create a whole new class of numbers and call them "pedantic" numbers, just so these conversations will be even more incomprehensible.

And then you'll realize there is a Numberphile video about them from 2017.

b0lt
Apr 29, 2005

Hammerite posted:

But to provide slightly less pedantic content for the thread:

code:
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 1.0 / 0.0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: float division by zero
>>>
what's with this? Shouldn't I get infinity as a result and not an exception? I thought Python floats were IEEE double-precision. Aren't they breaking the rules here?

no, ieee754 defines that you get either infinity or an exception

Adbot
ADBOT LOVES YOU

Evil_Greven
Feb 20, 2007

Whadda I got to,
whadda I got to do
to wake ya up?

To shake ya up,
to break the structure up!?
I hate this:
C++ code:
void blah(uint32_t x) {
  int y = static_cast<int>(x); //32-bit unsigned to 64-bit signed is fine right?
  if(0 < y) {
    //do something with y
  }
}
0 was the default value, no negative was expected since value was from unsigned, and most significant bit was set in x.
C++ is the horror here.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply