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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:17:18+00:00 2026-06-09T05:17:18+00:00

Converting numbers from double-precision floating-point format to single-precision floating-point format results in loss of

  • 0

Converting numbers from double-precision floating-point format to single-precision floating-point format results in loss of precision. What’s the algorithm used to achieve this conversion?

Are numbers greater than 3.4028234e+38 or lesser than -3.4028234e+38 simply reduced to the respective limits? I feel that the conversion process is a bit more involved than this but I couldn’t find documentation for it.

  • 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-06-09T05:17:20+00:00Added an answer on June 9, 2026 at 5:17 am

    The most common floating-point formats are the binary floating-point formats specified in the IEEE 754 standard. I will answer your question for these formats. There are also decimal floating-point formats in the new (2008) version of the standard, and there are formats other than the IEEE 754 standard, but the 754 binary formats are by far the most common. Some information about rounding, and links to the standard, are in this Wikipedia page.

    Converting double precision to single precision is treated the same as rounding the result of any operation. (E.g., an addition, multiplication, or square root has an exact mathematical value, and that value is rounded according to the rules to produce the result returned from the operation. For purposes of conversion, the input value is the exact mathematical value, and it is rounded.)

    Generally, the computing environment has some default rounding mode. (Various programming languages may provide ways to change the default rounding mode or to specify it particularly with each operation.) The default rounding mode is commonly round-to-nearest. Others are round-toward-zero, round-toward-positive-infinity (upward), and round-toward-negative-infinity (downward).

    In round-to-nearest mode, the representable number nearest the exact value is returned. If there is a tie, then the number with the even low bit (in its fraction or significand) is returned. For this purpose, infinity effectively acts as if it were the next value in the pattern of finite numbers. In single-precision, the greatest finite numbers are 0x1.fffff8p127, 0x1.fffffap127, 0x1.fffffcp127, and 0x1.fffffep127. (There are 24 bits in the single-precision significand, so a step in that bit is a step of 2 in that last hexadecimal digit.) For rounding purposes, infinity acts as if it were at 0x2p128. So, if the exact result is closer to 0x1.fffffep127 (thus, less than 0x1.ffffffp127), it is rounded to 0x1.fffffep127. If it is greater than or equal to 0x1.ffffffp127, it is rounded to infinity. The situation for negative infinity is symmetric.

    In round-toward-infinity mode, the nearest representable value that is greater than or equal to the exact value is returned. So any value above 0x1.fffffep127 rounds to infinity. Round-toward-negative-infinity returns the nearest representable value that is less than or equal to the exact vaue. Round-toward-zero returns the nearest representable value in the direction toward zero.

    The IEEE 754 standard only specifies the result; it does not specify the algorithm. The method used to achieve the rounding is up to each implementation.

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

Sidebar

Related Questions

I'm converting a legacy app from ISO-8859-1 to UTF-8, and I've used a number
I'm converting double to float using ye old float myFloat = (float)myDouble . This
MS Excel has eaten my head. It is randomly converting numbers into scientific notation
I have a function that returns log10 values. On converting them to normal numbers,
Converting json to oher type should be easy. From the Play! documentation : var
Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is
I am trying to write a method that converts from engineering notation to double
I am converting an extremely large and very old (25 years!) program from C
I have been converting some code from C++ to C#. My lack of understanding
I used the base converter from here and changed it to work with ulong

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.