Nice, is working, thank you!
And how about types, are they correct?
They should work for x in the Longint range. You should check also if frac(x) is zero and output int(x) and 1. The code crashes e.g. for x=1.0+MaxLongint because k1 will become zero and h1/k1 throws a divide-by-zero
exception.