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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:26:46+00:00 2026-05-24T10:26:46+00:00

I am trying to convert an 80-bit extended precision floating point number (in a

  • 0

I am trying to convert an 80-bit extended precision floating point number (in a buffer) to double.
The buffer basically contains the content of an x87 register.

This question helped me get started as I wasn’t all that familiar with the IEEE standard.
Anyway, I am struggling to find useful info on subnormal (or denormalized) numbers in the 80-bit format.
What I know is that unlike float32 or float64 it doesn’t have a hidden bit in the mantissa (no implied addition of 1.0), so one way to know if a number is normalized is to check if the highest bit in the mantissa is set. That leaves me with the following question:

From what wikipedia tells me, float32 and float64 indicate a subnormal number with a (biased) exponent of 0 and a non-zero mantissa.

  • What does that tell me in an 80-bit float?
  • Can 80-bit floats with a mantissa < 1.0 even have a non-zero exponent?
  • Alternatively, can 80-bit floats with an exponent of 0 even have a mantissa >= 1.0?

EDIT: I guess the question boils down to:

Can I expect the FPU to sanitize exponent and highest mantissa bit in x87 registers?

If not, what kind of number should the conversion result in? Should I ignore the exponent altogether in that case? Or is it qNaN?

EDIT:

I read the FPU section in the Intel manual (Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1: Basic Architecture) which was less scary than I had feared. As it turns out the following values are not defined:

  • exponent == 0 + mantissa with the highest bit set
  • exponent != 0 + mantissa without the highest bit set

It doesn’t mention if these values can appear in the wild, nor if they are internally converted.
So I actually dusted off Ollydbg and manually set bits in the x87 registers.
I crafted ST(0) to contain all bits set in the exponent and a mantissa of 0. Then I made it execute

FSTP QWORD [ESP]
FLD QWORD [ESP]

The value stored at [ESP] was converted to a signaling NaN.
After the FLD, ST(0) contained a quiet NaN.

I guess that answers my question. I accepted J-16 SDiZ‘s solution because it’s the most straight forward solution (although it doesn’t explicitly explain some of the finer details).

Anyway, case solved. Thanks, everybody.

  • 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-24T10:26:46+00:00Added an answer on May 24, 2026 at 10:26 am

    Try SoftFloat library, it have floatx80_to_float32, floatx80_to_float64 and floatx80_to_float128. Detect the native format, act accordingly.

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

Sidebar

Related Questions

I'm trying to convert a 32-bit float into an extended precision 80-bit float. I'm
I am trying to convert an IEEE based floating point number to a MIL-STD
I'm trying to convert the hexadecimal representation of a 64-bit number (e.g., the string
I am trying to convert AD maxpwdAge (a 64-bit integer) into a number of
I'm trying to convert the below bit of code into VB (and obviously apply
I'm trying to convert old QuickTime framework code to the 64-bit Cocoa-based QTKit on
I'm simply trying to convert a CGEventTimestamp (which is an unsigned 64-bit integer roughly
I'm trying to convert a 128-bit unsigned integer stored as an array of 4
I have been fighting with this for a bit now. I’m trying to convert
I'm trying to convert an HTML block which is basically in the following form

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.