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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:26:34+00:00 2026-05-23T16:26:34+00:00

I asked a question earlier about comparing numbers using the And comparison operator in

  • 0

I asked a question earlier about comparing numbers using the “And” comparison operator in If Statements and now I have been toying around with getting my head wrapped around bitwise operators. So I have written a very basic code that will allow me to see the conversion of any decimal number in binary format.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    MsgBox(ConvertToBinary(-1))
End Sub

Public Function ConvertToBinary(ByVal someInteger As SByte) As String
    Dim converted As String = Convert.ToString(someInteger, 2) '.PadLeft(8, "a"c)
    Return converted
End Function

Notice here that I am using SByte as the paramerter – which should only contain 8 bits right? However, the message box that appears has 16 bits assigned to negative numbers. Positive numbers have the correct 8.

  • 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-23T16:26:35+00:00Added an answer on May 23, 2026 at 4:26 pm

    There is no Convert.ToString overload that takes an SByte, so the SByte is being implicitly converted to a Short.

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

Sidebar

Related Questions

I asked a simialr question earlier about using jquery and hashtags but what I
I asked a question earlier about which language to use for an AI prototype.
I asked a question earlier about why left joins in Linq can't use defined
I asked a question earlier about keyhooks in vb.net. My current issue is such:
I asked a question earlier about ESBs written in Erlang or Java, and there
Ok, I asked a question earlier about Flex and ADO.NET Data Services but didn't
This is related to this question I asked earlier about syntax highlighting user-defined blocks
Earlier I asked a question about why I see so many examples use the
Earlier today I asked a question about environ , and one of the more
Earlier today I asked a question about passing dictionary values to a function. While

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.