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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:22:18+00:00 2026-05-19T09:22:18+00:00

Initially I thought Math.Sign would be the proper way to go but after running

  • 0

Initially I thought Math.Sign would be the proper way to go but after running a test it seems that it treats -0.0 and +0.0 the same.

  • 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-19T09:22:18+00:00Added an answer on May 19, 2026 at 9:22 am

    Here’s a grotty hack way of doing it:

    private static readonly long NegativeZeroBits =
        BitConverter.DoubleToInt64Bits(-0.0);
    
    public static bool IsNegativeZero(double x)
    {
        return BitConverter.DoubleToInt64Bits(x) == NegativeZeroBits;
    }
    

    Basically that’s testing for the exact bit pattern of -0.0, but without having to hardcode it.

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

Sidebar

Related Questions

I initially thought that 64 bit instructions would not work on OS-X 10.5. I
I initially thought they're all the same, but it turned out to be wrong.
I initially thought that using a view would be the best option because I've
I initially thought that how to pass class attribute and value to markdown syntax
Initially I thought this was going to work, but now I understand it won't
I initially thought this was a problem with my .htaccess files, however even after
I am struggling with a SQL query that I initially thought should be quite
I'm running into an IE8 issue which I initially thought was due to lack
For example: a) int [x][y][z] vs b) int[x*y*z] Initially thought I'd go with a)
My animationDidStop method is not being called for some reason, initially I thought it

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.