im making a program which uses binarys so convert decimal numbers, characters, strings to binary numbers and work with them. but i got stucked because i want to divide Bin with Bin. something like this: 11010110110000 / 10011 = 01001110110000 so the new number will the 1001110110000 / 10011... until the weri last result here is my code: import Data.Char (ord) import Data.List toBinary :: Int -> [Int] toBinary 0 = [] toBinary x = reverse (kisegf x) kisegf 0 = [] kisegf x | x `mod` 2 == 1 = 1 : kisegf (x `div` 2) | x `mod` … |
+0 forum
0 | ||

Hello, i want a program which convert Dec,Char,String to Bin. but i got stucked in Char because i want to do 8 bit long list and if its not 8 long i put zeros in the front but something always wrong. import Data.Char (ord) toBinary :: Int -> [Int] toBinary 0 = [] toBinary x = reverse (kisegf x) kisegf 0 = [] kisegf x | x `mod` 2 == 1 = 1 : kisegf (x `div` 2) | x `mod` 2 == 0 = 0 : kisegf (x `div` 2) chrToBinary :: Char -> [Int] chrToBinary x | length … |
+0 forum
0 | ||

Let me start off by saying that this is homework, and I have most of it completed. However, I am stuck on how to convert decimal to hexadecimal. The assignment is to add two hexadecimal numbers and output the answer. If the length of the answer is greater than 10 digits, then output "Addition Overflow." I've completed the conversion of the two strings to decimal and added them together, now I think that I need to convert the answer back to a string. I know it's long, but if you would take the time to read my code, then it … |
+0 forum
42 | ||

guys i just ask some questions about making a dev c++ codes in ascending numbers order. executing the first number then the next number increasing the number adds to it. its like a loop. tnx guys for d help. any help. pls. im needing dis for my defend. im starting to make a program but always fail. :< |
+0 forum
10 | ||

Hi, I found a number of post talking about this in C, but could not solve it in C++. I have 4 hex characters to represent a length. These need to be stored like this, in the case where length=16 ([URL="http://www.easycalculation.com/decimal-converter.php"]this online converter[/URL] told me that 16 converts to A in hex). [CODE] char bufferlength[4] = {0x00,0x00,0x00,0x0A};[/CODE] My problem. How do I get this, when all I have is length=300. I have heard people mentioning DWORD, and also found the following code that converts an int n to hex. But I would like to find a built in function that … |
+0 forum
16 |

The End.