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

  • SEARCH
  • Home
  • 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 3806038
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:46:21+00:00 2026-05-19T14:46:21+00:00

This is purely out of curiosity, but why does this occur? >>> a =

  • 0

This is purely out of curiosity, but why does this occur?

>>> a = float('Nan')
>>> a**2.0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: (33, 'Domain error')

I would have expected it to simply return NaN instead of generating an error.

  • 1 1 Answer
  • 1 View
  • 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-19T14:46:22+00:00Added an answer on May 19, 2026 at 2:46 pm

    From http://www.mail-archive.com/relax-devel@gna.org/msg00337.html, it seems that this is only the case on the windows builds, due to how the compiler implements floating point stuff.

    • Would some of the people who can’t reproduce post their OS?
    • Would someone having a 2.x on windows installed try it out (I get the same error on 3.1.3 (on Windows 7 32 bit))?
    • @OP: You are using windows, yes?

    Example

    Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> float('NaN')
    nan
    >>> _**2
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: (33, 'Domain error')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is purely out of curiosity. I am off school for the summer,
This is purely a curiosity item -- the solution turned out to be to
Purely out of curiosity, which browsers does Base64 image embedding work in? What I'm
These questions are purely asked out of curiosity. I don't actually need to subclass
This is a purely pedantic question, to sate my own curiosity. I tend to
I was (purely out of curiosity) trying to find out what the size of
Forewarning: a potentially silly question, purely out of curiosity. If, for example, I perform
I understand this is purely a coding related forum, but i believe techies can
Purely out of curiosity, is there a more elegant way to simply get the
A question purely for curiosity's sake. This is obviously invalid syntax: foo = {}

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.