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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:55:34+00:00 2026-05-17T14:55:34+00:00

I wrote this code to overload the unary operator- on a matrix class: const

  • 0

I wrote this code to overload the unary operator- on a matrix class:

const RegMatrix RegMatrix::operator-()const{
    RegMatrix result(numRow,numCol);
    int i,j;
    for(i=0;i<numRow;++i)
        for(j=0;j<numCol;++j){
            result.setElement(i,j,(-_matrix[i][j]));
        }

        return result;
}

When i ran my program with debugger in visual studio, it showed me that when the operation is done on a double equals zero, it inserts the result matrix the number -0.00000.
Is it some weird VS-display feature, or is it something i should handle carefully?

  • 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-17T14:55:35+00:00Added an answer on May 17, 2026 at 2:55 pm

    Signed zero is zero with an associated
    sign. In ordinary arithmetic, −0 = +0
    = 0. However, in computing, some number representations allow for the
    existence of two zeros, often denoted
    by −0 (negative zero) and +0 (positive
    zero). This occurs in some signed
    number representations for integers,
    and in most floating point number
    representations. The number 0 is
    usually encoded as +0, however it can
    be represented by either +0 or −0.

    The IEEE 754 standard for floating
    point arithmetic (presently used by
    most computers and programming
    languages that support floating point
    numbers) requires both +0 and −0. The
    zeroes can be considered as a variant
    of the extended real number line such
    that 1/−0 = −∞ and 1/+0 = +∞, division
    by zero is only undefined for ±0/±0.

    Negatively signed zero echoes the
    mathematical analysis concept of
    approaching 0 from below as a
    one-sided limit, which may be denoted
    by x → 0−, x → 0−, or x → ↑0. The
    notation “−0” may be used informally
    to denote a small negative number that
    has been rounded to zero. The concept
    of negative zero also has some
    theoretical applications in
    statistical mechanics and other
    disciplines.

    It is claimed that the inclusion of
    signed zero in IEEE 754 makes it much
    easier to achieve numerical accuracy
    in some critical problems,1 in
    particular when computing with complex
    elementary functions.[2] On the other
    hand, the concept of signed zero runs
    contrary to the general assumption
    made in most mathematical fields (and
    in most mathematics courses) that
    negative zero is the same thing as
    zero. Representations that allow
    negative zero can be a source of
    errors in programs, as software
    developers do not realize (or may
    forget) that, while the two zero
    representations behave as equal under
    numeric comparisons, they are
    different bit patterns and yield
    different results in some operations.

    For more information see Signed Zero wiki page.

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

Sidebar

Related Questions

I wrote this code I have these errors Cannot implicitly convert type x.Program.TreeNode' to
If I wrote this code: typeof(myType).TypeHandle Would it use reflection? How much different from:
Hi guys I wrote this code and i have two errors. Invalid rank specifier:
I was trying to understand something with pointers, so I wrote this code: #include
I want to convert function object to function. I wrote this code, but it
I wrote this snippet of code and I assume len is tail-recursive, but a
First a little intro: Last year i wrote this http://dragan.yourtree.org/code/canvas-3d-graph/ Now, i want to
I wrote a PHP code like this $site=http://www.google.com; $content = file_get_content($site); echo $content; But
I wrote this code: <?php mysql_connect(localhost, root, root) or die(Could not connect: . mysql_error());
Is there a better way to write this code? I want to show a

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.