Click here to Skip to main content
15,917,971 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What the NaN? Pin
Midi_Mick2-Oct-16 7:41
professionalMidi_Mick2-Oct-16 7:41 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 8:47
professionalSander Rossel2-Oct-16 8:47 
GeneralRe: What the NaN? Pin
Mladen Janković2-Oct-16 10:11
Mladen Janković2-Oct-16 10:11 
GeneralRe: What the NaN? Pin
BillWoodruff2-Oct-16 11:39
professionalBillWoodruff2-Oct-16 11:39 
GeneralRe: What the NaN? Pin
Nagy Vilmos2-Oct-16 7:10
professionalNagy Vilmos2-Oct-16 7:10 
GeneralRe: What the NaN? Pin
Cornelius Henning2-Oct-16 7:36
professionalCornelius Henning2-Oct-16 7:36 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 8:49
professionalSander Rossel2-Oct-16 8:49 
GeneralRe: What the NaN? Pin
Jochen Arndt2-Oct-16 10:22
professionalJochen Arndt2-Oct-16 10:22 
Comparing a floating point value with NaN always returns false (an "unordered result"; even when both operands are NaN).

This can be seen at your 3rd test. With the Min() code, all values are checked if they are smaller than the others. Because comparing with NaN is always false, no other element is detected as smaller and the check retunrs NaN. With the Max() code the values are compared to be greater which always fails for NaN.

See also NaN - Wikipedia, the free encyclopedia[^].
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 10:33
professionalSander Rossel2-Oct-16 10:33 
GeneralRe: What the NaN? Pin
BillWoodruff2-Oct-16 12:23
professionalBillWoodruff2-Oct-16 12:23 
GeneralRe: What the NaN? Pin
Mladen Janković2-Oct-16 12:40
Mladen Janković2-Oct-16 12:40 
GeneralRe: What the NaN? Pin
BillWoodruff2-Oct-16 16:17
professionalBillWoodruff2-Oct-16 16:17 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 20:34
professionalSander Rossel2-Oct-16 20:34 
GeneralRe: What the NaN? Pin
Jochen Arndt2-Oct-16 15:04
professionalJochen Arndt2-Oct-16 15:04 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 20:36
professionalSander Rossel2-Oct-16 20:36 
GeneralRe: What the NaN? Pin
Jochen Arndt2-Oct-16 23:20
professionalJochen Arndt2-Oct-16 23:20 
GeneralRe: What the NaN? Pin
harold aptroot2-Oct-16 11:02
harold aptroot2-Oct-16 11:02 
GeneralRe: What the NaN? Pin
Mladen Janković2-Oct-16 11:04
Mladen Janković2-Oct-16 11:04 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 11:13
professionalSander Rossel2-Oct-16 11:13 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 11:19
professionalSander Rossel2-Oct-16 11:19 
NewsRe: What the NaN? Pin
Super Lloyd2-Oct-16 12:02
Super Lloyd2-Oct-16 12:02 
GeneralRe: What the NaN? Pin
BillWoodruff2-Oct-16 16:22
professionalBillWoodruff2-Oct-16 16:22 
GeneralRe: What the NaN? Pin
Super Lloyd2-Oct-16 19:28
Super Lloyd2-Oct-16 19:28 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 20:38
professionalSander Rossel2-Oct-16 20:38 
GeneralRe: What the NaN? Pin
den2k882-Oct-16 20:59
professionalden2k882-Oct-16 20:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.