About 195,000 results
Open links in new tab
  1. Convert decimal to binary in python - Stack Overflow

    Aug 20, 2010 · For the sake of completion: if you want to convert fixed point representation to its binary equivalent you can perform the following operations: Get the integer and fractional part. from decimal import * a = Decimal(3.625) a_split = (int(a//1),a%1) Convert the fractional part in its binary representation. To achieve this multiply successively by 2.

  2. How to convert from decimal to binary .NET - Stack Overflow

    Jan 2, 2017 · I'm a bit confused on decimal to binary number conversion. Here's my code: Public Class Form1 Private Sub tbxDecimal_TextChanged(sender As Object, e As EventArgs) Handles tbxDecimal.TextChang...

  3. loops - LC-3 Decimal to Binary Converter - Stack Overflow

    Nov 12, 2015 · A binary mask is useful in assembly because it gives us the power to examine a single bit in a decimal or hex value. Example: If we look at the decimal number 5 we know its binary value is 0101 , when we AND R4, R4, R5 on our first loop we compare 1000 with 0101 .

  4. Is there a pre-defined built-in function to convert a number to its ...

    There is one function available itoa present in the stdlib.h by which we can convert integer to string. It is not exactly defined in C or C++ but supported by many compilers.

  5. Convert integer to binary in C# - Stack Overflow

    This function will convert integer to binary in C#. To convert integer to Binary, we repeatedly divide the quotient by the base, until the quotient is zero, making note of the remainders at each step (used Stack.Push to store the values).

  6. Converting integer to binary in Python - Stack Overflow

    The Python package Binary Fractions has a full implementation of binaries as well as binary fractions. You can do your operation as follows: from binary_fractions import Binary b = Binary(6) # Creates a binary fraction string b.lfill(8) # Fills to length 8 This package has many other methods for manipulating binary strings with full precision.

  7. Converting Decimal to Binary Java - Stack Overflow

    Feb 9, 2013 · Binary to Decimal without using Integer.ParseInt(): import java.util.Scanner; //convert binary to decimal number in java without using Integer.parseInt() method.

  8. c++ - Decimal to binary converting - Stack Overflow

    here a simple converter by using std:: ... // function to convert decimal to binary void decToBinary(int n ...

  9. How to convert decimal to binary in JS? - Stack Overflow

    Sep 30, 2014 · Both binary and decimal are string representations of a number with different radix. That's the reason why we need to specify the radix when getting a number from a string: binary = '10101' decimal = '21' Number.parseInt(binary, 2) === Number.parseInt(decimal, 10) // …

  10. vb.net - Binary Converter to Decimal with .NET - Stack Overflow

    Jan 21, 2014 · Edit: See below for going the other way!! I misread. Binary to Decimal: Public Function ConvertFromBinary(ByVal input As String) As Integer Dim ret As Integer = 0 Dim splitInput As Char() = input.ToCharArray Dim modifier As Integer = 1 For i As Integer = splitInput.Length - 1 To 0 Step -1 Dim thisChar As Integer = Val(splitInput(i)) If thisChar = 1 …

Refresh