Python
# x=整数(正を想定), b=小数部のビット数, p=小数点以下の桁数【丸めなし、切り捨て】
# p=-1 は b 桁
# p=0 は int(b * 0.301) 桁
# (p > 0) は p 桁
fixdec = (lambda x, b, p=0: (lambda x, b, p, f: f(x >> b, x & ((1 << b) - 1), b, p))
(x, b, (b, int(b * 0.301), p)[min(2, p + 1)],
lambda h, l, b, p: (('%d.' % h) + ('%d' % (((l | (1 << b)) * (10**p)) >> b))[1:])))
テスト
>>> for p in [0, 32, -1]: print(fixdec(1, 64, p)) ...
0.0000000000000000000
0.00000000000000000005421010862427
0.0000000000000000000542101086242752217003726400434970855712890625
>>> for p in [0, 48, -1]: print(fixdec(1, 96, p))
...
0.0000000000000000000000000000
0.000000000000000000000000000012621774483536188886
0.000000000000000000000000000012621774483536188886587657044524579674771302961744368076324462890625