2
votes
1answer
50 views

Significance of the number -947483647

I'm migrating some code from a compiler with 32-bit integers to 64-bit. I found some old code that assumes the highest possible integer is 2147483647 and the lowest possible is -947483647. I ...
-3
votes
1answer
35 views

Truncation in Two's Complement? [closed]

I'm struggling to understand how truncation works when converting from unsigned to Two's Complement. Can someone please explain? (my textook uses the example of truncating a 4 bit value to a 3 bit ...
0
votes
1answer
60 views

Python: Read binary file into buffer as integer then Slice

In python, how do i load a binary file into a buffer then read individual bytes as numbers not strings.?
-9
votes
1answer
59 views

Generate a Binary File [closed]

I need to generate Binary numbers (Single Bit: ONLY 0 or 1 as Binary and NOT integers) and write them to a file I repeat again, I need them BINARY. this means I don't want to convert an integer to ...
0
votes
2answers
62 views

How to convert an integer to binary form in Go and vice versa

How do i convert an Integer to binary form? I'm currently working on a program that takes an integer and converts it to binary form. It should also take the binary number and reverse it and convert ...
0
votes
2answers
57 views

Reading in positive long integer values into an array

I'm looking to read in a file of type .dat. I do not know the size of the file, however I do know that the contents will be in the form of 111000111 0101 0100 1 0011 110 0010 101 0001 11 0000 ...
0
votes
1answer
143 views

Converting integer to binary/decimal in MIPS assembly?

I have a program, in MIPS, which passes either the value '2' or '10' in a register to a function which is supposed to then print some integer in binary or decimal, depending on whether 2 or 10 was ...
0
votes
1answer
21 views

Best Way to Switch a Bit in an Integer?

Say I want to switch the 5th bit in a 32-bit / 64-bit integer (zero based, bit-index = 4). What's the most performant way to do that ? Example in byte length: 01001010 → 01011010 Languages of ...
0
votes
2answers
36 views

Java Enormous Integers [duplicate]

How can you represent integer arithmetic for numbers larger than what a 32 or 64 bit processor allows. I'm trying to write a small Java calculator, and the input would have to be a string of numbers ...
5
votes
3answers
249 views

Read / Write Haskell Integer in two's complement representation

I need to read and write Integers in a way that is compatible with what Java does with it's BigInteger class: Returns a byte array containing the two's-complement representation of this ...
1
vote
1answer
91 views

0-1 integer linear programming approximation algorithms

Hi I am looking for an approximation algorithm for 0-1 integer linear programming. Currently the approximation algorithms I find need to relax the interval to be [0,1]. However, my problem can only ...
2
votes
2answers
102 views

Using Python to convert integer to binary

I'm trying to convert integer to binary. This is my work. I don't know how the make a list to show the binary. num_str = input("Please give me a integer: ") num_int = int(num_str) while num_int ...
0
votes
2answers
414 views

Converting a non-integer number to binary in MATLAB

When I try and convert a decimal number such as 1.571 into binary, I get 0 for all values that are not integers. Is there a way to display a fractional number in binary in MATLAB? here is an excerpt ...
-1
votes
2answers
887 views

How many bits do you need to store a number?

How many bits would you need to store a number for example in the billions. Would you have to use the log2 N to find this out?
1
vote
2answers
244 views

RapidMiner - binomial to integer conversion

I need to pass data to Neural Net operator. Some attributes are binomial and Neural Net does not accept binomial data type, however it accepts integer. There is no Binomial to Integer (Numerical) ...

1 2 3 4
15 30 50 per page