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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:05:29+00:00 2026-05-10T16:05:29+00:00

The .net framework includes Math.IEEERemainder(x, y) in addition to the standard mod operator. What

  • 0

The .net framework includes Math.IEEERemainder(x, y) in addition to the standard mod operator. What is this function really doing? I dont understand the negative numbers that this produces.

Example:

Math.IEEERemainder(0, 2) = 0 Math.IEEERemainder(1, 2) = 1 Math.IEEERemainder(2, 2) = 0 Math.IEEERemainder(3, 2) = -1 
  • 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. 2026-05-10T16:05:29+00:00Added an answer on May 10, 2026 at 4:05 pm

    If you read the example given at System.Math.IEEERemainder’s MSDN page, you’ll notice that two positive numbers can have a negative remainder.

    Return Value

    A number equal to x – (y Q), where Q is the quotient of x / y rounded to the nearest integer (if x / y falls halfway between two integers, the even integer is returned).

    So: 3 – (2 * (round(3 / 2))) = -1

    /* ... Divide two double-precision floating-point values: 1) The IEEE remainder of 1.797693e+308/2.00 is 0.000000e+000 2) The IEEE remainder of 1.797693e+308/3.00 is -1.000000e+000 Note that two positive numbers can yield a negative remainder.  */ 

    Epilogue

    The actual question could be, "Why do we have two remainder operations?" When dealing with floating point data, you always need to be cognizant of your floating point standard. Since we’re in the 21st century, most everything is on IEEE 754 and very few of us worry about say VAX F_Float versus IEEE 754.

    The C# standard states that the remainder operator (Section 7.7.3), when applied to floating point arguments, is analogous to the remainder operator when applied to integer arguments. That is, the same mathematical formula1 is used (with additional considerations for corner cases associated with floating point representations) in both integer and floating point remainder operations.

    Therefore, if you are looking to have your remainder operations on floating point numbers conform to your current IEEE 754 rounding modes, it is advisable to use Math.IEEERemainder. However, if your usage is not particularly sensitive to the subtle difference in rounding produced by the C# remainder operator, then continue using the operator.

    1. Given: z = x % y, then z = x – (x / y) * y
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 144k
  • Answers 144k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I believe this is the code you're looking for: DataTable… May 12, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer As I mentioned before, you have to get the width… May 12, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer It looks like what you want is to use either… May 12, 2026 at 8:43 am

Related Questions

Using Visual Studio 2008, I created a C++ Win32 project. To release the program,
I'm looking for an ORM that offers complete or near-complete LINQ support. LINQ to
I'm a Linux n00b, and I want to install SciPy to help me on
I'm working on a P2P application, and I need to get it to communicate

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.