Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
NaN
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Integer NaN == Most fixed-size [[integer]] formats cannot explicitly indicate invalid data. In such a case, when converting NaN to an integer type, the [[IEEE 754]] standard requires that the invalid-operation [[IEEE 754#Exception handling|exception]] be signaled. For example in [[Java programming language|Java]], such operations throw instances of {{code|java.lang.ArithmeticException}}.<ref>{{cite web|url=http://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html|title=ArithmeticException (Java Platform SE 8)|website=docs.oracle.com}}</ref> In [[C (programming language)|C]], they lead to [[undefined behavior]], but if annex F is supported, the operation yields an "invalid" floating-point exception (as required by the IEEE standard) and an unspecified value. [[Perl]]'s {{code|Math::BigInt}} package uses "NaN" for the result of strings that do not represent valid integers.<ref>{{cite web|title=<code>Math::BigInt</code>|url=http://perldoc.perl.org/Math/BigInt.html#Input|website=perldoc.perl.org|access-date=12 June 2015}}</ref> <syntaxhighlight lang="console"> > perl -mMath::BigInt -e "print Math::BigInt->new('foo')" NaN </syntaxhighlight>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
NaN
(section)
Add topic