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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:39:11+00:00 2026-05-18T19:39:11+00:00

I don’t think this is possible, hence I decided to ask here to see

  • 0

I don’t think this is possible, hence I decided to ask here to see as googling around hasn’t returned any results that hint that I can do so.

Especially after reading this:

Can doubles be used to represent a 64 bit number without loss of precision

Though my numbers can be held in 32bit as the example below shows.

But is there any way in MATLAB to convert a double precision value to single without loosing information?

e.g. in MATLAB

> a = 103364148
a =
   103364148
> single(a)
ans =
   103364144

Or maybe there is another way in another language, e.g. Python?

I’m working with GPUMat where I can only use GPUSingle, so I’m trying to find a way to work with stuff that is double to MATLAB in single to the GPU.

Thanks,

  • 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-18T19:39:12+00:00Added an answer on May 18, 2026 at 7:39 pm

    A single can hold integer numbers up to 2^24 (16,777,216) without loss of precision – some bits are required for the sign and the exponent .

    In other words, no, there is no way that you can make a number larger than 2^24 fit into a single without error (note that it can hold some larger numbers, as long as they can be written as the product of a number smaller 2^24 and some power of 2).

    However, are you sure you need that kind of precision for your calculations? As long as all your integers are less than 2^24, you should be fine.

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

Sidebar

Related Questions

(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't ask why but I have the requirement to draw a border around certain
Don't know if anyone can help me with this or if it's even possible.
Don't know if this is the right place to ask this, but I will
Don't think my virtualhost is working correctly. This is what I have inside of
Don't know if this is possible, but I have some code like this: val
don't know if this is possible.. I'm using sqlite3 schema: CREATE TABLE docs (id
Don't mind me, I fricked up my attribute names :( This is entirely possible,
Don't ask me why but i can't use this method because I need to
Don't think there's much to say, here's my code for (int i = 0;

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.