Sponsored Content
Top Forums Programming How bit representation of a number can be done in c? Post 302902265 by jim mcnamara on Monday 19th of May 2014 04:28:04 PM
Old 05-19-2014
This looks like homework to me, but I'll give you a start. Bit inversion is usually taken to mean reversing the order of bits, BTW. "flip" means change from 1->0 or 0->1.

Use a bit field to see what is set, or you can use any of dozens of bit twiddles - which I suspect is what your teacher wants you to do.

See:

Bit Twiddling Hacks

Note: if this is homework , please post in the correct forum - some other moderator may close this thread otherwise.
This User Gave Thanks to jim mcnamara For This Post:
 

5 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. Shell Programming and Scripting

Help needed in converting number to bit

Hi, I have the following file input:- 542 4795 61 543 4795 61 544 0 0 545 292 ... (5 Replies)
Discussion started by: ahjiefreak
5 Replies

3. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

4. Programming

Number to bit vector

Is there a function to convert number (unsigned int for this example) to binary? I could not find a simple one thru google. While I was learning bloom filter with the example, I was wondering if anybody can help me to 1) display the real bits vector for the bloomfilter; 2) if dataset is very... (11 Replies)
Discussion started by: yifangt
11 Replies

5. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
SDF2FPS(1)							   User Commands							SDF2FPS(1)

NAME
sdf2fps - sdf2fps DESCRIPTION
usage: sdf2fps [-h] [--id-tag TAG] [--fp-tag TAG] [--num-bits INT] [--errors {strict,report,ignore}] [-o FILENAME] [--software TEXT] [--type TEXT] [--decompress METHOD] [--binary] [--binary-msb] [--hex] [--hex-lsb] [--hex-msb] [--base64] [--cactvs] [--decoder DECODER] [--pubchem] [filenames [filenames ...]] Extract a fingerprint tag from an SD file and generate FPS fingerprints positional arguments: filenames input SD files (default is stdin) optional arguments: -h, --help show this help message and exit --id-tag TAG get the record id from TAG instead of the first line of the record --fp-tag TAG get the fingerprint from tag TAG (required) --num-bits INT use the first INT bits of the input. Use only when the last 1-7 bits of the last byte are not part of the fingerprint. Unexpected errors will occur if these bits are not all zero. --errors {strict,report,ignore} how should structure parse errors be handled? (default=strict) -o FILENAME, --output FILENAME save the fingerprints to FILENAME (default=stdout) --software TEXT use TEXT as the software description --type TEXT use TEXT as the fingerprint type description --decompress METHOD use METHOD to decompress the input (default='auto', 'none', 'gzip', 'bzip2') Fingerprint decoding options: --binary Encoded with the characters '0' and '1'. Bit #0 comes first. Example: 00100000 encodes the value 4 --binary-msb Encoded with the characters '0' and '1'. Bit #0 comes last. Example: 00000100 encodes the value 4 --hex Hex encoded. Bit #0 is the first bit (1<<0) of the first byte. Example: 01f2 encodes the value x01xf2 = 498 --hex-lsb Hex encoded. Bit #0 is the eigth bit (1<<7) of the first byte. Example: 804f encodes the value x01xf2 = 498 --hex-msb Hex encoded. Bit #0 is the first bit (1<<0) of the last byte. Example: f201 encodes the value x01xf2 = 498 --base64 Base-64 encoded. Bit #0 is first bit (1<<0) of first byte. Example: AfI= encodes value x01xf2 = 498 --cactvs CACTVS encoding, based on base64 and includes a version and bit length --decoder DECODER import and use the DECODER function to decode the fingerprint shortcuts: --pubchem decode CACTVS substructure keys used in PubChem. Same as --software=CACTVS/unknown --type 'CACTVSE_SCREEN/1.0 extended=2' --fptag=PUBCHEM_CACTVS_SUBSKEYS --cactvs sdf2fps 1.0 June 2012 SDF2FPS(1)
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy