Sponsored Content
Top Forums Programming C function "strtoull" failing Post 302858857 by shamrock on Tuesday 1st of October 2013 02:00:43 PM
Old 10-01-2013
There's something goofy in your program so post it here so others can look at it...as the max value of ULL "18446744073709551615" is way bigger than "5368709120" so im not sure how you are getting wrong results...
This User Gave Thanks to shamrock For This Post:
 

9 More Discussions You Might Find Interesting

1. Programming

How to convert the "select" function into a "poll" function

i have a program using the select function but i want to convert it to poll... how can i do this? thanks in advance... :) (1 Reply)
Discussion started by: rbolante
1 Replies

2. Solaris

sendto failing "resource temporarily unavailable"

Well, I am not even sure if its failing, cause at the other end I have a select call and it wakes up and reads the data I sent fine. Ok here is the issue, I have a UDP socket(non blocking) through which I push some data to another port. At the other end I have select loop, waiting for this data.... (6 Replies)
Discussion started by: Naanu
6 Replies

3. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

4. HP-UX

ERROR: more than one instance of overloaded function "vprintf" has "C" linkage

Hi people! I've got this own library: -------------------------------------------- Personal.h -------------------------------------------- #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdarg.h> #include <string.h> ... (0 Replies)
Discussion started by: donatoll
0 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. HP-UX

DLT 7000 tape drive failing with "write error on a record in the index"

HP rp5450 (L2000) running HP-UX 11.11B Using DLT 7000 and DLT 4000 tape drives for nightly full backups Backup jobs created by SAM DLT 7000 cron entry is as follows: 00 2 * * 1-6 /usr/sam/lbin/br_backup DLT FULL Y /dev/rmt/0m /var/sam/graphLCAa17036 root Y 1 N > /var/sam/SAM_br_msgs 2>&1... (1 Reply)
Discussion started by: dreh99
1 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
BINDEC(3)								 1								 BINDEC(3)

bindec - Binary to decimal

SYNOPSIS
number bindec (string $binary_string) DESCRIPTION
Returns the decimal equivalent of the binary number represented by the $binary_string argument. bindec(3) converts a binary number to an integer or, if needed for size reasons, float. bindec(3) interprets all $binary_string values as unsigned integers. This is because bindec(3) sees the most significant bit as another order of magnitude rather than as the sign bit. PARAMETERS
o $binary_string - The binary string to convert Warning The parameter must be a string. Using other data types will produce unexpected results. RETURN VALUES
The decimal value of $binary_string EXAMPLES
Example #1 bindec(3) example <?php echo bindec('110011') . " "; echo bindec('000110011') . " "; echo bindec('111'); ?> The above example will output: 51 51 7 Example #2 bindec(3) interprets input as unsigned integers <?php /* * The lesson from this example is in the output * rather than the PHP code itself. */ $magnitude_lower = pow(2, (PHP_INT_SIZE * 8) - 2); p($magnitude_lower - 1); p($magnitude_lower, 'See the rollover? Watch it next time around...'); p(PHP_INT_MAX, 'PHP_INT_MAX'); p(~PHP_INT_MAX, 'interpreted to be one more than PHP_INT_MAX'); if (PHP_INT_SIZE == 4) { $note = 'interpreted to be the largest unsigned integer'; } else { $note = 'interpreted to be the largest unsigned integer (18446744073709551615) but skewed by float precision'; } p(-1, $note); function p($input, $note = '') { echo "input: $input "; $format = '%0' . (PHP_INT_SIZE * 8) . 'b'; $bin = sprintf($format, $input); echo "binary: $bin "; ini_set('precision', 20); // For readability on 64 bit boxes. $dec = bindec($bin); echo 'bindec(): ' . $dec . " "; if ($note) { echo "NOTE: $note "; } echo " "; } ?> Output of the above example on 32 bit machines: input: 1073741823 binary: 00111111111111111111111111111111 bindec(): 1073741823 input: 1073741824 binary: 01000000000000000000000000000000 bindec(): 1073741824 NOTE: See the rollover? Watch it next time around... input: 2147483647 binary: 01111111111111111111111111111111 bindec(): 2147483647 NOTE: PHP_INT_MAX input: -2147483648 binary: 10000000000000000000000000000000 bindec(): 2147483648 NOTE: interpreted to be one more than PHP_INT_MAX input: -1 binary: 11111111111111111111111111111111 bindec(): 4294967295 NOTE: interpreted to be the largest unsigned integer Output of the above example on 64 bit machines: input: 4611686018427387903 binary: 0011111111111111111111111111111111111111111111111111111111111111 bindec(): 4611686018427387903 input: 4611686018427387904 binary: 0100000000000000000000000000000000000000000000000000000000000000 bindec(): 4611686018427387904 NOTE: See the rollover? Watch it next time around... input: 9223372036854775807 binary: 0111111111111111111111111111111111111111111111111111111111111111 bindec(): 9223372036854775807 NOTE: PHP_INT_MAX input: -9223372036854775808 binary: 1000000000000000000000000000000000000000000000000000000000000000 bindec(): 9223372036854775808 NOTE: interpreted to be one more than PHP_INT_MAX input: -1 binary: 1111111111111111111111111111111111111111111111111111111111111111 bindec(): 18446744073709551616 NOTE: interpreted to be the largest unsigned integer (18446744073709551615) but skewed by float precision NOTES
Note The function can convert numbers that are too large to fit into the platforms integer type, larger values are returned as float in that case. SEE ALSO
decbin(3), octdec(3), hexdec(3), base_convert(3). PHP Documentation Group BINDEC(3)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy