Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6978099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:42:43+00:00 2026-05-27T17:42:43+00:00

When is an operation on a NaN variable valid? I would say never. Yet

  • 0

When is an operation on a NaN variable valid? I would say never.

Yet in AS3 no exception is thrown and the default of 0 is returned when a operation is attempted on such a variable.

Why doesn’t AS3 throw an exception here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:42:43+00:00Added an answer on May 27, 2026 at 5:42 pm

    No exception is thrown in AS3 when dealing with NaN because AS3 is a dialect of ECMAScript, which in turn implements IEEE 754, which defines the bahavior of NaN. This standard is implemented in a bunch of languages and architectures, including ones that do not have robust exception handling. NaN represents a way to express these values without requiring exceptions, in a way that is well understood and well documented across a bunch of platforms and languages.

    If it wasn’t implemented against the standard, then I would be willing to wager there would be people here asking “Why does AS3 throw and exception rather than returning NaN like every other IEEE 754 floating point implementation does?!”

    See “What Every Computer Scientist Should Know About Floating-Point Arithmetic…” for a quick overview on floating point math and NaN in general, and check out the wikipedia on NaN, and you’ll see there are actually two types of NaN defined by the standard. A quiet NaN and a signaling NaN.

    When is an operation on a NaN variable valid? I would say never.

    No offense intended, I don’t think that you are in the best position to make that absolute statement, because honestly, a lot of people a lot smarter than you in their profession thought about it and didn’t come to the same conclusion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got exception : Operation is not valid while ItemsSource is in use. Access
Possible Duplicate: Cross-thread operation not valid I am trying to close the base of
In C operation associativity is as such for increment, decrement and assignment. 2. postfix
how can I replace the NaN value in an array, zero if an operation
Synchronous operation. GetLastError = 0, WinHttpQueryDataAvailable itself returns TRUE (i.e. OK) yet the number
Which operation i.e a 32 bit operation or a 64 bit operation (like masking
My operation system is Window XP in Chinese. I'm running flex sdk > asdoc
I have a timely operation that runs on a background thread. While running, I
For a one-shot operation, i need to parse the contents of an XML string
How can the XOR operation (on two 32 bit ints) be implemented using only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.