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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:07:15+00:00 2026-06-09T01:07:15+00:00

Hmm, this may seems a simple question, but I would like to know the

  • 0

Hmm, this may seems a simple question, but I would like to know the fastest way.

I have an object which is a boxed number, I don’t know is it double, int, or some numeric type. I want to check if the boxed value is negative.

I use this conversion but I am not sure if it is as fast as can be:

private bool CheckNegative(object number)
{
   return System.Convert.ToDouble(number) < 0;
}

Arsen

  • 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-09T01:07:17+00:00Added an answer on June 9, 2026 at 1:07 am

    It seems like the only way to do it.

    But if you wanted to avoid writing multiple functions that take double, int, float, etc to check for negative number, I would redirect you to following post: https://stackoverflow.com/a/828820/150830

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

Sidebar

Related Questions

Hmm...this question may sounds silly , hope you all don't mind... If I have
I have got this assignment question on HMM and I have solved it. I
Hmm i would have thought this would be a little more straightforward.. in my
Hmm. I found this which seems promising: http://sourceforge.net/projects/mjpg-streamer/ Ok. I will try to explain
Hmm.. I am not sure how to describe this. But I will try So
Hmm well there's lots here about this but I can't seem to get a
I use this http://goo.gl/d3vLW code for my project, but it's not working the way
I'm sure this question has already been asked in one form or another, but
Hmm this is strange. It works in IE but not FF. Please take a
[EDIT] Hmm. Perhaps this question should be titled what is the default user-input dialog

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.