Click here to Skip to main content
15,914,500 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
Sander Rossel2-Oct-16 8:34
professionalSander Rossel2-Oct-16 8:34 
GeneralRe: What the NaN? Pin
Florian Rappl2-Oct-16 20:17
professionalFlorian Rappl2-Oct-16 20:17 
GeneralRe: What the NaN? Pin
Richard MacCutchan2-Oct-16 6:52
mveRichard MacCutchan2-Oct-16 6:52 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 8:44
professionalSander Rossel2-Oct-16 8:44 
GeneralRe: What the NaN? PinPopular
Mladen Janković2-Oct-16 9:54
Mladen Janković2-Oct-16 9:54 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 10:13
professionalSander Rossel2-Oct-16 10:13 
GeneralRe: What the NaN? Pin
Mladen Janković2-Oct-16 10:24
Mladen Janković2-Oct-16 10:24 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 11:05
professionalSander Rossel2-Oct-16 11:05 
Tried to read it once, but to me it makes as much sense as the whole NaN implementation: none whatsoever (and I admit my limited math skills are to blame).
However, I tried reading the NaN part and what they basically say is that in some edge cases you don't want computations to stop (throw exceptions) when some bogus values are inserted (e.g. divide by 0). The workaround without NaN would be to catch exceptions and simply try again. Unfortunately, every language handles exceptions differently so they standardized on NaN.

Awesome, they destroyed our numeric system to support some edge cases (correct me if I'm wrong) Big Grin | :-D

Luckily .NET offers some sensible numeric types with int, long and decimal Big Grin | :-D
Unfortunately, I'm currently working in JavaScript, with floating point arithmetic, where NaN is quite common, and 0.1 + 0.2 equals 0.30000000000000004 (yes, I know that's IEEE754, but that doesn't make it right) Sigh | :sigh:
Read my (free) ebook Object-Oriented Programming in C# Succinctly.
Visit my blog at Sander's bits - Writing the code you need.
Or read my articles here on CodeProject.
Simplicity is prerequisite for reliability.
— Edsger W. Dijkstra
Regards,
Sander

GeneralRe: What the NaN? Pin
Mladen Janković2-Oct-16 12:33
Mladen Janković2-Oct-16 12:33 
GeneralRe: What the NaN? Pin
Richard MacCutchan2-Oct-16 22:41
mveRichard MacCutchan2-Oct-16 22:41 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 22:51
professionalSander Rossel2-Oct-16 22:51 
GeneralRe: What the NaN? Pin
Richard MacCutchan2-Oct-16 22:54
mveRichard MacCutchan2-Oct-16 22:54 
GeneralRe: What the NaN? Pin
Sander Rossel2-Oct-16 23:20
professionalSander Rossel2-Oct-16 23:20 
GeneralRe: What the NaN? Pin
Richard MacCutchan2-Oct-16 23:30
mveRichard MacCutchan2-Oct-16 23:30 
GeneralRe: What the NaN? Pin
Sander Rossel3-Oct-16 6:00
professionalSander Rossel3-Oct-16 6:00 
GeneralRe: What the NaN? Pin
Richard MacCutchan3-Oct-16 6:21
mveRichard MacCutchan3-Oct-16 6:21 
GeneralRe: What the NaN? Pin
Theraot4-Oct-16 1:33
Theraot4-Oct-16 1:33 
GeneralRe: What the NaN? Pin
Herbie Mountjoy4-Oct-16 2:25
professionalHerbie Mountjoy4-Oct-16 2:25 
GeneralRe: What the NaN? Pin
Richard MacCutchan4-Oct-16 3:42
mveRichard MacCutchan4-Oct-16 3:42 
GeneralRe: What the NaN? Pin
Richard MacCutchan4-Oct-16 6:13
mveRichard MacCutchan4-Oct-16 6:13 
GeneralRe: What the NaN? Pin
Sander Rossel4-Oct-16 8:02
professionalSander Rossel4-Oct-16 8:02 
GeneralRe: What the NaN? Pin
Fly Gheorghe4-Oct-16 5:52
Fly Gheorghe4-Oct-16 5:52 
GeneralRe: What the NaN? Pin
Richard MacCutchan4-Oct-16 6:13
mveRichard MacCutchan4-Oct-16 6:13 
GeneralRe: What the NaN? Pin
Manfred Rudolf Bihy3-Oct-16 8:19
professionalManfred Rudolf Bihy3-Oct-16 8:19 
GeneralRe: What the NaN? Pin
Sander Rossel3-Oct-16 8:30
professionalSander Rossel3-Oct-16 8:30 

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.