ID:1973047
 
(See the best response by Lummox JR.)
Code:
/mob/dead/observer/verb/analyze_air()
set name = "Analyze Air"
set category = "Ghost"

if(!istype(usr, /mob/dead/observer)) return

// Shamelessly copied from the Gas Analyzers
if (!( istype(usr.loc, /turf) ))
return

var/datum/gas_mixture/environment = usr.loc.return_air()

var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles

src << "\blue <B>Results:</B>"
if(abs(pressure - ONE_ATMOSPHERE) < 10)
src << "\blue Pressure: [round(pressure,0.1)] kPa"
else
src << "\red Pressure: [round(pressure,0.1)] kPa"
if(total_moles)
for(var/g in environment.gas)
src << "\blue [gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]% ([round(environment.gas[g], 0.01)] moles)"
src << "\blue Temperature: [round(environment.temperature-T0C,0.1)]&deg;C ([round(environment.temperature,0.1)]K)"
src << "\blue Heat Capacity: [round(environment.heat_capacity(),0.1)]"

/datum/gas_mixture/proc/return_pressure()
if(volume)
return total_moles * R_IDEAL_GAS_EQUATION * temperature / volume
return 0


Problem description:
The code is somewhat simple, really. All it does is read out the given atmos info. I am trying to delve into this for a friend, but these two things are happening:
http://puu.sh/kYCtH/e0782099af.png
http://puu.sh/kYDvD/72915cf92d.png
I'm like 95% sure that total_moles is somehow getting divided by 0 at somepoint. Would that cause a value like this? If so, what is the difference between #IND and #QNAN?
Division by zero causes an actual runtime error.
If I recall correctly, IND is Indeterminate and QNAN is "Nan" or null.

Quickly checked the Red Book, I believe I'm correct.

I wonder, are you using Windows 10 to host this environment? I think that's what 1.#QNAN is from. I've never seen it before, but Kaiochao also has seen it under Windows 10.

1.#IND is common if you are doing math using numbers that are not precise, or numbers too close to zero and numbers too 'close' to infinity.

These numbers/numeric symbols aren't defined by BYOND, they're from the OS. So, you may just be doing math horribly wrong, using numbers/decimals that are too small or too long.
Yeah, I remember indefinite values having interesting results in various games. For instance, playing Text City Simulator Version 2 (first game I made of course, which was really the first time I encountered it) would result in instant impeachment/game over should one get hit with -1.#IND.

Eventually found a way to reproduce it easily. I used to see NAN (which is Not A Number) popup in other games.
Best response
The Q is a new one on me. Must be some stupid thing in the OS. Wish to frell that this crap would just have been standardized 20 years ago.