Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

There a NaN Seats Available  RSS feed

 
Ron McLeod
Saloon Keeper
Posts: 1527
210
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was hoping to book some rail travel from Vancouver to Seattle, but sadly there were NaN reserveable coach seats available ...



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66041
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Must be from Maine. "We don' put up with NaN of that nonsense up heeyar."
 
Campbell Ritchie
Marshal
Posts: 54883
155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is worse than that; NaN people have already reserved seats.
 
Liutauras Vilda
Marshal
Posts: 4260
256
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought they introduced bug in calculations, hence got - "Not a Number".
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote:I thought they introduced bug in calculations, hence got - "Not a Number".

But it is funnier to make jokes
 
Ron McLeod
Saloon Keeper
Posts: 1527
210
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It't the number of people that is a floating‑point number, some of them not being all there.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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? 
 
Liutauras Vilda
Marshal
Posts: 4260
256
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NaN is defined as 0.0 ÷ 0.0. You can get NaN from various functions e.g. Math.sqrt(−1).
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66041
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every time I see this topic, it makes me hungry.

 
Campbell Ritchie
Marshal
Posts: 54883
155
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know weak puns are allowed on Fridays.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear: What is that? It doesn't look like pie?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66041
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Naan, a flatbread that I usually associate with Indian food. And completely delicious!
 
Campbell Ritchie
Marshal
Posts: 54883
155
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you got for something like a Peshwari naan, you are better off with chapattis.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!