- 1

**NaN**reserveable coach seats available ...

- 1

- 1

`"Not a Number"`.

- 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

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?

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?

[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

- 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

`Math.sqrt(−1)`.

- 3

- 2

[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

- 1