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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:29:56+00:00 2026-06-11T18:29:56+00:00

Is it possible to lose any fidelity or precision going from a numpy float32

  • 0

Is it possible to lose any fidelity or precision going from a numpy float32 to a python float (float64) back to a numpy float32?

I can’t seem to find a case where there is data lost but everyone around me is claiming that the world will end because there is data lost. I just need to find a document/example that proves that data is lost before I continue.

Any help pointing me in the right direction is appreciated.

Here is a typical use case I’m seeing:

def serialize(val):
    # val is a np.float32
    return val.astype(float)


def deserialize(msg):
    return np.float32(msg)

message = '1.23456789'
outgoing = serialize(message)
incoming = deserialize(message)
  • 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-11T18:29:57+00:00Added an answer on June 11, 2026 at 6:29 pm

    If x is a float32 then float32(float64(x)) == x.

    The one exception being if x = nan then nan != nan, although nan is nan, hence if you want to catch all you could use:

    float32(float64(x)) == x or x is nan
    

    .

    You should take care:

    float32(1./3)          # 0.33333334
    float64(float32(1./3)) # 0.3333333432674408
    float64(0.33333334)    # 0.33333333999999998
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With repeatable read isolation level, it is still possible to lose updates (second lost
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
Possible Duplicate: Python : how to append new elements in a list of list?
I had an annoying issue, getting a Possible loss of precision error when compiling
Is it possible to commit a single change to SVN without committing any of
Is it possible to lose data if a SQLite DB is not closed properly
Introduction I know I'm going to lose a lot of reputation for this question

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.