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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:07:03+00:00 2026-05-24T12:07:03+00:00

I have to convert some C code (that ran in a Linux machine) to

  • 0

I have to convert some C code (that ran in a Linux machine) to .Net, and found some operations with long double. They are not special operations, just some multiplications and divisions that end with a lot of decimals, it seems the type was used just because of its size.

What would you do in order to convert the code? I’m thinking of just multiply the values and divide back at the end to see if it helps since the code is anyway returning short values at the end, plus I don’t know if the original binary was indeed using all the size a long double can provide or if it was just using a common 64-bit double under the hood.

If you don’t think this is a good idea, do you know of any class or structure that can be used to wrap and simulate a long double? Making a wrapper in C/C++ and call it from .Net is “not possible”.

  • 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-24T12:07:03+00:00Added an answer on May 24, 2026 at 12:07 pm

    It’s most likely that the C long double actually mapped to a double and so without knowing more about the calculations I’d assume you were fine to use double in C#.

    In my experience it’s very rare to find a scientific or engineering calculation for which 64 bit double is not sufficient.

    The only way to be 100% certain that double is sufficient would be to study the algorithm so this advice is based on instinct and experience alone.

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

Sidebar

Related Questions

I have some c(++) code that uses sprintf to convert a uint_64 to a
I have some code from my VB.NET 1.1 days that allowed me to dynamically
I have to convert some code from classic ASP to ASP.NET 1) How can
Possible Duplicate: Convert some code from C++ to C I've got some code that
I have some code that downloads an image from a remote server $data =
I have some old code that I'm converting to use in Windows Phone. The
I have some original code that manages exception safety like this: void foo() {
I'm writing some code in VB.Net which I hope demonstrate to colleagues (not to
I have some code (which works fine) that looks something like this: int integer
I'm refactoring some code and I have written a method that modifies a Dictionary

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.