Campbell Ritchie

Marshal

Posts: 54883

155

posted 4 weeks 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 4 weeks 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: 54883

155

posted 4 weeks 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 4 weeks 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: 54883

155

Campbell Ritchie

Marshal

Posts: 54883

155

posted 3 weeks 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 3 weeks ago

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

It is sorta covered in the JavaRanch Style Guide. |