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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:33:44+00:00 2026-06-17T21:33:44+00:00

is there a .NET library that can perform a numerical operation and return a

  • 0

is there a .NET library that can perform a numerical operation and return a value?

I have an expression like so:

1 + 1/2

this should return the double equivalent of the same.
I wont be passing a string, it will be a numeric value and the return should be a numeric.

  • 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-17T21:33:45+00:00Added an answer on June 17, 2026 at 9:33 pm

    I’ve used NCalc for medium-to-complex calculations and it seems that it will fit your needs.


    About the OP’s comment on the original question:

    double d = 1/2;
    

    will return 0 in c#, because the integer 1 is divided by the integer 2, resulting in an integer result of 0.

    If you need to trigger real-number mathematics, at least one of the operands must be defined as a real number. You can do that by specifying it with a decimal point (1.0 instead of 1), or by adding a type specifier after the value (1f or 1d instead of 1).
    Take a look at this example:

    double d1 = (1 + 1/2); //returns 1
    double d2 = (1 + 1.0/2); //returns 1.5
    double d3 = (1 + 1/2.0); //returns 1.5
    double d4 = (1 + 1f/2); //returns 1.5
    double d5 = (1 + 1d/2); //returns 1.5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an open source .NET library that can render PDFs to images (for
Is there a .NET-accessible (i.e. .NET or COM) library that I can use to
Is there a library for .NET that does parenthesis or expression reduction and optimization?
Is there a .NET library that I can use to sync a folder to
Is there a JavaScript library that can perform timing of the webpage when it
is there a C#/.NET library or otherwise existing code that can read persisted data
Does a library exist in .net that can perform queries server-side? The reason I
I need a .NET OAuth Library that can support OAuth version 2.0. Is there
Is there a build in library in .NET that can compute secure one-way hash
Is there any Library for .NET that returns SPARQL results in some structured List

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.