{ $description "Sets the file permissions for a given file with the supplied Unix permissions integer. Supplying an octal number with " { $link POSTPONE: OCT: } " is recommended." }
{ $description "Creates a " { $link bits } " object out of the given number, using its log base 2 as the length. This implies that the last element, corresponding to the most significant bit, will be 1." }
{ $examples
- { $example "USING: math.bits prettyprint arrays ;" "BIN: 1101 make-bits >array ." "{ t f t t }" }
+ { $example "USING: math.bits prettyprint arrays ;" "0b1101 make-bits >array ." "{ t f t t }" }
{ $example "USING: math.bits prettyprint arrays ;" "-3 make-bits >array ." "{ t f }" }
{ $description "Returns the number of set bits as an object. This word only works on non-negative integers or objects that can be represented as a byte-array." }
@@ -6,7+6,7 @@ ARTICLE: "stream-binary" "Working with binary data"
$nl
"There are two ways to order the bytes making up an integer; " { $emphasis "little endian" } " byte order outputs the least significant byte first, and the most significant byte last, whereas " { $emphasis "big endian" } " is the other way around."
$nl
-"Consider the hexadecimal integer " { $snippet "HEX: cafebabe" } ". Little endian byte order yields the following sequence of bytes:"
+"Consider the hexadecimal integer " { $snippet "0xcafebabe" } ". Little endian byte order yields the following sequence of bytes:"
{ $notes "This word implements bitwise inclusive or, so applying it to booleans will throw an error. Boolean inclusive or is the " { $link and } " word." } ;
{ $notes "This word implements bitwise exclusive or, so applying it to booleans will throw an error. Boolean exclusive or is the " { $link xor } " word." } ;
HELP: shift
{ $values { "x" integer } { "n" integer } { "y" integer } }
{ $description "Shifts " { $snippet "x" } " to the left by " { $snippet "n" } " bits if " { $snippet "n" } " is positive, or " { $snippet "-n" } " bits to the right if " { $snippet "n" } " is negative. A left shift of a fixnum may overflow, yielding a bignum. A right shift may result in bits “falling off” the right hand side and being discarded." }
"Hexadecimal float literals are also supported. These consist of a hexadecimal literal with a decimal point and an optional base-two exponent expressed as a decimal number after " { $snippet "p" } " or " { $snippet "P" } ":"
{ $example
- "8.0 HEX: 1.0p3 = ."
+ "8.0 0x1.0p3 = ."
"t"
}
{ $example
- "1024.0 HEX: 1.0P10 = ."
+ "1024.0 0x1.0P10 = ."
"t"
}
{ $example
- "10.125 HEX: 1.44p3 = ."
+ "10.125 0x1.44p3 = ."
"t"
}
"The normalized hex form " { $snippet "HEX: ±1.MMMMMMMMMMMMMp±EEEE" } " allows any floating-point number to be specified precisely. The values of MMMMMMMMMMMMM and EEEE map directly to the mantissa and exponent fields of IEEE 754 representation."
- { HEX: 101E "HPDF_INVALID_BIT_PER_COMPONENT\nBit-per-component of a image which was set as mask-image is invalid." }
- { HEX: 101F "HPDF_INVALID_CHAR_MATRICS_DATA\nCannot recognize char-matrics-data of an afm file." }
- { HEX: 1020 "HPDF_INVALID_COLOR_SPACE\n1. The color_space parameter of HPDF_LoadRawImage is invalid.\n2. Color-space of a image which was set as mask-image is invalid.\n3. The function which is invalid in the present color-space was invoked." }
- { HEX: 1021 "HPDF_INVALID_COMPRESSION_MODE\nInvalid value was set when invoking HPDF_SetCommpressionMode()." }
- { HEX: 1022 "HPDF_INVALID_DATE_TIME\nAn invalid date-time value was set." }
+ { 0x1016 "HPDF_FILE_IO_ERROR\nFile processing failed. (A detailed code is set.)" }
+ { 0x1017 "HPDF_FILE_OPEN_ERROR\nCannot open a file. (A detailed code is set.)" }
+ { 0x1019 "HPDF_FONT_EXISTS\nTried to load a font that has already been registered." }
+ { 0x101A "HPDF_FONT_INVALID_WIDTHS_TABLE\nThe format of a font-file is invalid . Internal error. The consistency of the data was lost." }
+ { 0x101B "HPDF_INVALID_AFM_HEADER\nCannot recognize a header of an afm file." }
+ { 0x101C "HPDF_INVALID_ANNOTATION\nThe specified annotation handle is invalid." }
+ { 0x101E "HPDF_INVALID_BIT_PER_COMPONENT\nBit-per-component of a image which was set as mask-image is invalid." }
+ { 0x101F "HPDF_INVALID_CHAR_MATRICS_DATA\nCannot recognize char-matrics-data of an afm file." }
+ { 0x1020 "HPDF_INVALID_COLOR_SPACE\n1. The color_space parameter of HPDF_LoadRawImage is invalid.\n2. Color-space of a image which was set as mask-image is invalid.\n3. The function which is invalid in the present color-space was invoked." }
+ { 0x1021 "HPDF_INVALID_COMPRESSION_MODE\nInvalid value was set when invoking HPDF_SetCommpressionMode()." }
+ { 0x1022 "HPDF_INVALID_DATE_TIME\nAn invalid date-time value was set." }
+ { 0x1023 "HPDF_INVALID_DESTINATION\nAn invalid destination handle was set." }
+ { 0x1025 "HPDF_INVALID_DOCUMENT\nAn invalid document handle is set." }
+ { 0x1026 "HPDF_INVALID_DOCUMENT_STATE\nThe function which is invalid in the present state was invoked." }
+ { 0x1027 "HPDF_INVALID_ENCODER\nAn invalid encoder handle was set." }
+ { 0x1028 "HPDF_INVALID_ENCODER_TYPE\nA combination between font and encoder is wrong." }
+ { 0x102B "HPDF_INVALID_ENCODING_NAME\nAn Invalid encoding name is specified." }
+ { 0x102C "HPDF_INVALID_ENCRYPT_KEY_LEN\nThe lengh of the key of encryption is invalid." }
+ { 0x102D "HPDF_INVALID_FONTDEF_DATA\n1. An invalid font handle was set.\n2. Unsupported font format." }
+ { 0x102E "HPDF_INVALID_FONTDEF_TYPE\nInternal error. The consistency of the data was lost." }
+ { 0x102F "HPDF_INVALID_FONT_NAME\nA font which has the specified name is not found." }