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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:46:56+00:00 2026-06-03T10:46:56+00:00

I have a FLOAT(126) column that was mapped to a Decimal by the Entity

  • 0

I have a FLOAT(126) column that was mapped to a Decimal by the Entity Framework. It works both for writing and reading, except in one case.

When I write a high precision value such as:

1m / 3m = 0.33333333333333333333333333333333

I can’t read it, the framework throws an ArithmeticOverflowException.

How to solve that? My temporary solution is to round the number to 6 decimal places before inserting them. But what if I required the full precision?

  • 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-03T10:46:57+00:00Added an answer on June 3, 2026 at 10:46 am

    Decimal only support 28-29 significant digits ( http://msdn.microsoft.com/en-us/library/364x0z75.aspx ) and since EF doesn’t support custom type mapping like NHibernate does – it’s not possible to load more than the type can handle.

    I don’t know if it occurs to you but by converting a decimal to float you are losing precision and as you can see you end up with the quirky rounding that floats have. You really should be using decimal instead of float if you are after precision and also set the max significant digits to the max of decimal.

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

Sidebar

Related Questions

I have two float variables that are equal, I retrieve them by PHP and
Suppose, I have a float column and a a b-tree index and a million
When I have three divs that all have float left I want the sections
what's the purpose/point of the REAL() Datatype in mysql? You have float,double and decimal
I have a float datatype and it gets assigned to 10 decimal points. When
I have a float value that must be constrained to an multiple of 0.25.
I have a float array that I get from a sensor and want to
I have float field that contains (for example): 1234.5678. I would like to display
I have a float array representing a grayscale picture that I want to convert
I have a float: 1.2333333 How do I change it into a two decimal

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.