Campbell Ritchie

Marshal

Posts: 55722

163

posted 2 months ago

But it is funnier to make jokes

- 2

Liutauras Vilda wrote:I thought they introduced bug in calculations, hence got -"Not a Number".

But it is funnier to make jokes

[OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]

Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2

posted 2 months ago

Assuming that they are not selling tickets for for less an a whole seat, should the result of any calculation ever be a floating point value?

Liutauras Vilda wrote:I thought they introduced bug in calculations, hence got -"Not a Number".

Assuming that they are not selling tickets for for less an a whole seat, should the result of any calculation ever be a floating point value?

Campbell Ritchie

Marshal

Posts: 55722

163

posted 2 months ago

You can still try to divide an int by zero though. Doesn't that still give NaN?

Ron McLeod wrote:Liutauras Vilda wrote:I thought they introduced bug in calculations, hence got -"Not a Number".

Assuming that they are not selling tickets for for less an a whole seat, should the result of any calculation ever be a floating point value?

You can still try to divide an int by zero though. Doesn't that still give NaN?

Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2

posted 2 months ago

Nope, only floats. And in particular 0 / 0.0; changing first operand to positive > 0 gives infinity, to negative minus infinity. Maybe there are more cases for NaN though, don't know.

Since it is MD fora here, I'm free to assume what I want You might cannot buy half of a seat, but you can calculate how much it costs

- 1

Jeanne Boyarsky wrote:You can still try to divide an int by zero though. Doesn't that still give NaN?

Nope, only floats. And in particular 0 / 0.0; changing first operand to positive > 0 gives infinity, to negative minus infinity. Maybe there are more cases for NaN though, don't know.

Ron McLeod wrote:Assuming that they are not selling tickets for for less an a whole seat, should the result of any calculation ever be a floating point value?

Since it is MD fora here, I'm free to assume what I want You might cannot buy half of a seat, but you can calculate how much it costs

Campbell Ritchie

Marshal

Posts: 55722

163

Campbell Ritchie

Marshal

Posts: 55722

163

posted 2 months ago

Bear: What is that? It doesn't look like pie?

Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2

posted 2 months ago

Naan, a flatbread that I usually associate with Indian food. And completely delicious!

Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |