NaN

Nan or NAN may refer to one of the following.

*Nan district

Other

• Nan, a play by the English poet John Masefield, first produced in 1908, also known as The Tragedy of Nan
• Nan (artist) Thai pop musician (Sujelux Klongakkara)
• Naan, a type of leavened bread
• "Nan You're a Window Shopper", a song by English singer Lily Allen
• Nan, English term meaning Grandmother

In computing, NaN (Not a Number) is a value or symbol that is usually produced as the result of an operation on invalid input operands, especially in floating-point calculations. For example, most floating-point units are unable to explicitly calculate the square root of negative numbers, and will instead indicate that the operation was invalid and return a NaN result.

NaNs in floating point

In floating-point calculations, NaN is not the same as infinity, although both are typically handled as special cases in floating-point representations of real numbers as well as in floating-point operations. An invalid operation is also not the same as an arithmetic overflow (which might return an infinity) or an arithmetic underflow (which would return the smallest normal number, a denormal number, or zero).

IEEE 754 NaNs are represented with the exponential field filled with ones and some non-zero number in the significand. A bit-wise example of a IEEE floating-point standard single precision NaN: x11111111axxxxxxxxxxxxxxxxxxxxxx. x = undefined. If a = 1, it is a quiet NaN, otherwise it is a signalling NaN.

A NaN does not compare equal to any floating-point number or NaN, even if the latter has an identical representation. One can therefore test whether a variable has a NaN value by comparing it to itself (i.e. if x != x then x is NaN).

In the IEEE floating-point standard, arithmetic operations involving NaN always produce NaN, allowing the value to propagate through a calculation. In the current (proposed) IEEE 754r revision of that standard, there are several exceptions to this rule, including the maxnum and minnum functions, which return the maximum and minimum of two operands, and will favour numbers (if just one of the operands is a NaN then the other operand is returned). This behaviour is useful in the statistical processing of data with missing values, or sparse data.

A similar concept has been implemented in the NaN toolbox for GNU Octave and MATLAB. Here NaN's have a different meaning and are used to represent missing values. The NaN toolbox contains statistical functions that ignore any NaNs in the data rather than propagating the NaNs. Most algorithms in the NaN toolbox are based on the function SUMSKIPNAN [1] which adds and counts all data value and skips all NaNs. Every statistic in the NaN toolbox is based on the data values only, again useful in statistical processing on sparse data.

How is a NaN created?

The following practices may cause NaNs:
• All mathematical operations with a NaN as at least one operand
• The divisions 0/0, ∞/∞, ∞/-∞, -∞/∞, and -∞/-8
• The multiplications 0×∞ and 0×-8
• The additions ∞ + (-∞), (-∞) + ∞ and equivalent subtractions.
• Applying a function to arguments outside its domain, including taking the square root of a negative number, taking the logarithm of zero or a negative number, or taking the inverse sine or cosine of a number which is less than -1 or greater than +1.
However, it is important to realize that these NaNs are not necessarily generated by the processor. In the case of quiet NaNs the first item is always valid for each processor; the others may not necessarily be. For example, on the Intel Architecture processors, the FPU never creates a NaN except in the first case. The other items would cause exceptions, not NaNs. However, the software exception handler may examine the operands and decide to return a NaN (e.g. in the case of 0/0).

Quiet NaNs

Quiet NaNs, or qNaNs, do not raise any additional exceptions as they propagate through most operations. The exceptions are where the NaN cannot simply be passed through unchanged to the output, such as in format conversions or certain comparison operations (which do not "expect" a NaN input).

Signalling NaNs

Signalling NaNs, or sNaNs, are special forms of a NaN which when consumed by most operations should raise an invalid exception and then, if appropriate, be "quieted" into a qNaN which may then propagate. They were introduced in IEEE 754. There have been several ideas for how these might be used:
• Filling uninitialized memory with signalling NaNs would produce an invalid exception if the data is used before it is initialized
• Using an sNaN as a place holder for a more complicated object such as:
• a representation of a number which has underflowed
• a representation of a number which has overflowed
• number in a higher precision format
• a complex number
When encountered a trap handler could decode the sNaN and return an index to the computed result. In practice this approach is faced with many complications. The treatment of the sign bit of NaNs for some simple operations (such as absolute value) is different than for arithmetic operations. Traps are not required by the standard. There are other approaches to this sort of problem which would be more portable.

There were questions about if signalling NaNs should continue to be required in the revised standard. In the end it appears they will be left in.

NaNs in function definitions

There are differences of opinion about the proper definition for the result of a numeric function which receives a (quiet) NaN as input. One view is that the NaN should propagate to the output of the function in all cases to propagate the indication of an error. Another view is that if the function has multiple arguments and the output is uniquely determined by all the non-NaN inputs, then that value should be the result.

If we define pow(x,y) = x ** y What is pow(1, NaN)?

The first view is that the output should be NaN since one of the inputs is. The second view is that since pow(1, y) = 1 for any real number y, or even if y is infinity or -infinity, then it is appropriate to return 1 for the case of pow(1, NaN). This is the approach in many math libraries.

A similar concern is for the test

(x <= infinity)

which is true for all extended real values of x. But in IEEE 754 (NaN <= infinity) is false.

NaNs in integers

Most fixed sized integer formats do not have any way of explicitly indicating invalid data.

Perl's BigInt package uses "NaN" for the result of strings which don't represent valid integers. ` >perl -mMath::BigInt -e "print Math::BigInt->new('foo')" ` ` NaN `

Displaying NaN

Note that the software libraries of different operating systems and programming languages will have different string representations of NaN.

nan NaN NaN% NAN NaNQ NaNS qNaN sNaN 1.#SNAN 1.#QNAN

Since, in practice, encoded NaNs have both a sign and optional 'diagnostic information' (sometimes called a payload), these will often be found in string representations of NaNs, too, for example:

-NaN NaN12345 -sNaN12300

(other variants exist)

NaN encodings

The encoding to distinguish a signaling NaN from a quiet NaN was not specified in IEEE 754, which has led to at least two variant encodings. The current IEEE 754r proposal recommends (for binary encodings, in section 6.2.1) that the first fraction bit of the significand be set to one for a qNaN and be zero for an sNaN. This ensures that when an sNaN is converted to a qNaN (by inverting that bit) the result is guaranteed to still be a NaN (rather than perhaps an infinity, should all remaining bits of the significand be zero).

On processors from Intel and AMD the first fraction bit of a binary significand is set to one for a qNaN and is zero for an sNaN. Other vendors use different schemes.

For the proposed IEEE 754r decimal encodings, Infinities and NaNs are distinguished at a 'higher level', and so there is no confusion between NaNs and Infinities. Therefore, in this case, a 1 is used (in the equivalent position) to indicate sNaN, because turning this to 0 still indicates a (quiet) NaN. Hence, an initialization of all-ones sets any storage for these encodings to signaling-NaN, which is an appropriate setting for 'uninitialized' numeric data.

References

NMDA (N-methyl-D-aspartic acid) is an amino acid derivative acting as a specific agonist at the NMDA receptor, and therefore mimics the action of the neurotransmitter glutamate on that receptor.
receptor antagonist is a drug that does not provoke a biological response itself upon binding to a receptor, but blocks or attenuates agonist-mediated responses. It may be competitive (or surmountable), i.e.
Neurotoxicity occurs when the exposure to natural or manmade toxic substances, which are called neurotoxins, alters the normal activity of the nervous system. This can eventually disrupt or even kill neurons, key cells that transmit and process signals in the brain and other parts
Nadi International Airport (IATA: NAN, ICAO: NFFN) is the main international gateway for the islands of Fiji. It serves about 1.2 million people per year. It is also the main hub of Air Pacific.
Nan (Thai: น่าน) is one of the northern provinces (changwat) of Thailand. Neighboring provinces are (from south clockwise) Uttaradit, Phrae and Phayao. To the north and east it borders Xaignabouli of Laos.
Nan (Thai: น่าน) is a city in Northern Thailand. It is located at 18° 46 ' 58.80 " NR, +100° 46 ' 58.80 " E, some 668 km north of Bangkok. Its population exceeds 24.000 inhabitants.
Mueang Nan (Thai: เมืองน่าน) is the capital district (Amphoe Mueang) of Nan Province, northern Thailand.
Origin Nan Province
Mouth Chao Phraya River at Nakhon Sawan
Basin countries Thailand
Length 390 km (234 mi)

Basin area 57,947 km²

The Nan River is one of the most important tributaries of the Chao Phraya River.
Nan Shan (Chinese: 南山 "southern mountains") may refer to:
• Nanshan (南山区), a district of Shenzhen
• Nanshan (南山区), a district of Hegang.

This article or section needs copy editing for grammar, style, cohesion, tone and/or spelling.
You can assist by [ editing it] now. A how-to guide is available, as is general .
Naan (Urdu/Persian: نان, IPA [nɑn]) is a round flatbread made of white flour. Naan is a staple accompaniment to hot meals in Central and South Asia, including Afghanistan, Iran, India, Pakistan, Uzbekistan, Tajikistan and the surrounding region.
Genre Ska
Length 2:58
Label EMI
Writer(s) Lily Allen, Iyiola Babalola, Darren Lewis

Alright, Still track listing
"Alfie"
(11) "Nan You're a Window Shopper"
(12) "Smile" (version revisited)
(13)

Lily Rose Beatrice Allen (born May 2, 1985) is an English singer-songwriter best known for songs such as "Smile" and "LDN". She is the daughter of actor/musician Keith Allen and film producer Alison Owen.
computing is synonymous with counting and calculating. Originally, people that performed these functions were known as computers. Today it refers to a science and technology that deals with the computation and the manipulation of symbols.
In computing, floating-point is a numerical-representation system in which a string of digits (or bits) represents a real number. The most commonly encountered representation is that defined by the IEEE 754 Standard.
A floating point unit (FPU) is a part of a computer system specially designed to carry out operations on floating point numbers. Typical operations are addition, subtraction, multiplication, division, and square root.
The word infinity comes from the Latin infinitas or "unboundedness." It refers to several distinct concepts (usually linked to the idea of "without end") which arise in philosophy, mathematics, and theology.
The term arithmetic overflow or simply overflow has the following meanings.
1. In a digital computer, the condition that occurs when a calculation produces a result that is greater in magnitude than what a given register or storage location can store or represent.

Arithmetic underflow (or "floating point underflow", "floating underflow", "underflow") is a condition that can occur when the result of a floating point operation would be smaller in magnitude (closer to zero, either positive or negative) than the smallest quantity representable.
In computing, a normal number is a non-zero number in a floating-point representation which is within the balanced range supported by a given floating-point format.

The magnitude of the smallest normal number in a format is given by bemin
In computer science, denormal numbers or denormalized numbers (now often called subnormal numbers) fill the gap around zero in floating point arithmetic: any non-zero number which is smaller than the smallest normal number is 'sub-normal'.
0 (zero) is both a number and a numerical digit used to represent that number in numerals. It plays a central role in mathematics as the additive identity of the integers, real numbers, and many other algebraic structures.
The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is the most widely-used standard for floating-point computation, and is followed by many CPU and FPU implementations.
IEEE 754r is an ongoing revision to the IEEE 754 floating point standard. The intent of the revision is to extend the standard where it has become necessary, to tighten up certain areas of the original standard which were left undefined, and to merge in IEEE 854 (the
A statistic (singular) is the result of applying a function (statistical algorithm) to a set of data.
Maintainer: John W. Eaton

OS: Cross-platform

Use: Scientific computing