Nothing
I have nothing of interest to start thread with. Feel free to add something of interest..[:D]
0
-
Null has several meanings in computer programming.
Null pointer or null reference
* Null is a special pointer value (or other kind of object reference) used to signify that a pointer intentionally does not point to (or refer to) an object. Such a pointer is called a null pointer.[1] Many implementations use a value of 0 (all bits zero) to represent the null pointer, as this is at the bottom of the address space of most CPUs (although some architectures use a signed address space and use the most negative value). Many operating systems generate an exception when an attempt is made to access this memory address. Some languages use other nomenclature for such a pointer, e.g., Pascal uses nil[2], while Visual Basic uses Nothing.
Null value
* In many disciplines, the concept of null allows a three-valued logic, with null indicating "no value" or an "unknown value". The SQL database query language uses Null in this way, as do Visual Basic and its derivatives. In this model, an expression that depends on the value of a Null operand will evaluate to Null (VB) or "unknown" (SQL). So, for any A, the expressions "A = Null" and "A <> Null" are neither true nor false. However, the boolean operation "A and False" produces false, and similarly "A or True" is true, even when A is Null, because these expressions do not depend on the value of A. (Some SQL implementations may consider A = Null to be "true" if A is Null; see Null (SQL)).
Null string
* A null string, also known as an empty string, is a string of zero length. [3]
Null device
* In UNIX systems, /dev/null (also referred to as the black hole or bit bucket) is a special file that delivers no input when read from and discards all output when written to. The NUL device has similar functionality in DOS and Windows. On AmigaOS it is known as the NIL: device.
* In Windows XP, null device is a file in system32/drivers, named Null.sys, the size is 2944 bytes. It can be seen in device manager, non-plug-and-play group.
Null character
* In the C0 control code set defined in the ISO 646, ASCII, and Unicode character set standards, code value 0 is the null character (NUL). Most programming languages provide syntax for representing this character as a literal value (e.g., Pascal uses chr(0) or #0, C and its many derivatives use '\0'). [4]
* In some programming languages, the null character denotes the end of a character string. Such strings that are encoded with the ASCII character set are sometimes referred to as ASCIIZ or ASCIZ strings - the "Z" indicating that the string ends with a "Zero", or null character[5].
* When electromechanical teleprinters were used as computer output devices, one or more null characters were sent at the end of each printed line to allow time for the mechanism to return to the first printing position on the next line.
Null variant
* Some programming languages (such as LISP; Ruby; and Pascal, Delphi, and other languages based on Pascal) use nil for the null variant, which can sometimes lead to confusing errors if null is accidentally used instead of nil.
Null script / null subroutine
* A command script or program subroutine which does nothing but return a constant, given value. This is one of the tricks known throughout the software pirating community to bypass callbacks and license-checking code: the target program is disassembled and the offending code is substituted for a null subroutine that just returns the value expected by the caller.
Null Account
* On certain forums and other internet sites, user database corruption might cause user accounts to suddenly show up as "null" and have all their settings reset. Generally this will remove the user's ability to add new content to the site.
*******************************************
NaN
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.
Contents
* 1 NaNs in floating point
o 1.1 How is a NaN created?
o 1.2 Quiet NaNs
o 1.3 Signalling NaNs
* 2 NaNs in function definitions
* 3 NaNs in integers
* 4 Displaying NaN
* 5 NaN encodings
* 6 References
* 7 External links
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 \neq 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 so that errors can be detected early.
In the proposed IEEE 754r revision of that standard the same rule applies, except that a few anomalous functions (such as the maxnum function, which returns the maximum of two operands which are expected to be numbers) favour numbers-if just one of the operands is a NaN then the value of the other operand is returned.
A different approach has been implemented in the NaN 'toolbox' for GNU Octave and MATLAB. In that toolbox, NaNs are assumed to represent missing values and so the statistical functions ignore NaNs in the data instead of propagating them. Every computation in the NaN toolbox is based on the data values only, which can be useful if it is known that NaNs cannot be produced by errors.
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, #8734;/#8734;, #8734;/-#8734;, -#8734;/#8734;, and -#8734;/-#8734;
* The multiplications 0x#8734; and 0x-#8734;
* The additions #8734; + (-#8734;), (-#8734;) + #8734; 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 placeholder for a more complicated object such as:
o a representation of a number which has underflowed
o a representation of a number which has overflowed
o number in a higher precision format
o 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
[edit] 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.0 -
Thought it was nothin
But a lump in a fart is SOMETHING!0 -
Fig Newtons. 0 -
quote:Originally posted by The Dutchman
Fig Newtons.
Sorry dude, Fig Newtons are something... Something GOOD as a matter of fact!!!!0 -
Nothing is what Nunn will get for shooting CARTOD!!! 0 -
quote:Originally posted by hslaterpryce
Wasn't there a TV show about this - nothing?
Seinfeld0 -
quote:Originally posted by bama55
quote:Originally posted by hslaterpryce
Wasn't there a TV show about this - nothing?
Seinfeld
Will and Grace.0
Please sign in to leave a comment.
Comments
37 comments