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 7191667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:46:40+00:00 2026-05-28T19:46:40+00:00

What precision does numpy.float128 map to internally? Is it __float128 or long double? Or

  • 0

What precision does numpy.float128 map to internally? Is it __float128 or long double? Or something else entirely?

A potential follow on question if anybody knows: is it safe in C to cast a __float128 to a (16 byte) long double, with just a loss in precision? (this is for interfacing with a C lib that operates on long doubles).

Edit: In response to the comment, the platform is ‘Linux-3.0.0-14-generic-x86_64-with-Ubuntu-11.10-oneiric’. Now, if numpy.float128 has varying precision dependent on the platform, that is also useful knowledge for me!

Just to be clear, it is the precision I am interested in, not the size of an element.

  • 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-28T19:46:41+00:00Added an answer on May 28, 2026 at 7:46 pm

    It’s quite recommended to use longdouble instead of float128, since it’s quite a mess, ATM. Python will cast it to float64 during initialization.

    Inside numpy, it can be a double or a long double. It’s defined in npy_common.h and depends of your platform. I don’t know if you can include it out-of-the-box into your source code.

    If you don’t need performance in this part of your algorithm, a safer way could be to export it to a string and use strold afterwards.

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

Sidebar

Related Questions

Does anyone know how to find out the precision of long double on a
What output format does BitConverter.GetBytes generate? does it generate: IEEE standard for normalized single/double-precision
Unfortunately the specification does not tell anything about precision. The xml scheme definition states
Both are mathematical values, however the float does have more precision. Is that the
What is the difference between a single precision floating point operation and double precision
Does increasing the number of test cases training data in case of Precision Neural
Double values store higher precision and are double the size of a float, but
Follow-up to post: Using * Width & Precision Specifiers With boost::format I'm trying to
Is it possible to obtain more than 16 digits with double precision without using
i have a really big array of numbers with double precision...i tried to write

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.