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)
I have an assignment in which a character is the input of which some bits(from a position to certain position) are to be inverted (1's complement) and then the resultant character is to be returned....for example
unsigned char x = J from p = 3 to offset n = 5
01001010 inverted to... (1 Reply)
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
LEARN ABOUT NETBSD
humanize_number
HUMANIZE_NUMBER(9) BSD Kernel Developer's Manual HUMANIZE_NUMBER(9)NAME
humanize_number, format_bytes -- human readable numbers
SYNOPSIS
int
humanize_number(char *buf, size_t len, uint64_t number, const char *suffix, int divisor);
int
format_bytes(char *buf, size_t len, uint64_t number);
DESCRIPTION
The humanize_number() function formats the unsigned 64-bit quantity given in number into buf. A space and then suffix is appended to the
end. The supplied buf must be at least len bytes long.
If the formatted number (including suffix) is too long to fit into buf, humanize_number() divides number by divisor until it will fit. In
this case, suffix is prefixed with the appropriate SI designator. Suitable values of divisor are 1024 or 1000 to remain consistent with the
common meanings of the SI designator prefixes.
The prefixes are:
Prefix Description Multiplier
k kilo 1024
M mega 1048576
G giga 1073741824
T tera 1099511627776
P peta 1125899906842624
E exa 1152921504606846976
The len argument must be at least 4 plus the length of suffix, in order to ensure a useful result in buf.
The format_bytes() function is a front-end to humanize_number(). It calls the latter with a suffix of ``B''. Also, if the suffix in the
returned buf would not have a prefix, the suffix is removed. This means that a result of ``100000'' occurs, instead of ``100000 B''.
RETURN VALUES
Both functions return the number of characters stored in buf (excluding the terminating NUL) upon success, or -1 upon failure.
SEE ALSO humanize_number(3)HISTORY
These functions first appeared in NetBSD 1.5.
BSD August 7, 2010 BSD