[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pdf-devel] type 4 functions
From: |
Hardy Falk |
Subject: |
[pdf-devel] type 4 functions |
Date: |
Wed, 3 Oct 2007 18:07:07 +0200 |
User-agent: |
KMail/1.9.5 |
Hi there,
I have some difficulties with the spec:
From pdf_reference_1-7 section 3.39
... expressions involving integers, real numbers, and boolean
values only. ... For more
information on these operators, see Appendix B of the PostScript
Language Reference, Third Edition.)
Although the semantics are those of the corresponding
PostScript operators, a PostScript interpreter is not required.
input and output
of pdf functions are real numbers.
Excerpt from PLRM 8.3 "Operator Details":
"num1 num2 add --> sum"
returns the sum of num1 and num2.
If both operands are integers and the result is
within integer range, the result is an integer;
otherwise, the result is a real number.
"int1 int2 idiv --> quotient"
divides int1 by int2 and returns the integer part of the
quotient, with any fractional part discarded.
Both operands of idiv must be integers and the result is
an integer.
I am tempted to use double throughout, with conversions and
checks for bit operations and idiv,
but I am not sure whether the spec allows it.
The alternative, a tagged union, leads to very clumsy code
Any clarifications?
Type 0,2 and 3 functions are working now.
pdf_create_function takes dictionaries and streams.
testing works with a samples array in a dictionary, too.
- [pdf-devel] type 4 functions,
Hardy Falk <=