summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pstricks-add/pst-fp.tex
blob: 8cc3d9751f2773e97b7b73365be793463fa75f8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
%% $Id: pst-fp.tex 112 2009-04-17 19:21:56Z herbert $
%%
%%
%% This is file `pst-fp.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-fp.tex'
%%
%% Herbert Voss <Herbert.Voss _at_ pstricks.de>
%% stolen from the fp package by Michael Mehlich
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-fp' is a PSTricks related package for a division
%%
\csname PSTFPloaded\endcsname
\let\PSTFPloaded\endinput
%
% Requires some packages
\ifx\PSTricksLoaded\endinput\else\input pstricks \fi
%
\def\fileversion{0.02}
\def\filedate{2009/04/02}
\message{`pst-fp' v\fileversion, \filedate\space (hv)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax

%fixed point arithmetic with values between (including)
%      -999999999999999999.999999999999999999
% and  +999999999999999999.999999999999999999

\def\pstFPdiv#1#2#3{\pstFP@callc\pstFP@div#1{#2}{#3}}        % #1 := #2/#3

\countdef\pstFP@actcounter=10 % register 0 for counter
\ifnum\pstFP@actcounter<60\relax \pstFP@actcounter=60\fi

\newcount\pstFP@xs %sign of 1st value
\newcount\pstFP@xia%integer part of 1st value
\newcount\pstFP@xib%integer part of 1st value
\newcount\pstFP@xfa%fractional part of 1st value
\newcount\pstFP@xfb%fractional part of 1st value

\countdef\pstFP@ys=5 %sign of 2nd value
\countdef\pstFP@yia=6%integer part of 2nd value
\countdef\pstFP@yib=7%integer part of 2nd value
\countdef\pstFP@yfa=8%fractional part of 2nd value
\countdef\pstFP@yfb=9%fractional part of 2nd value

\countdef\pstFP@xk=10  %registers for splitting 1st value
\countdef\pstFP@xl=11
\countdef\pstFP@xm=12
\countdef\pstFP@xn=13
\countdef\pstFP@xo=14
\countdef\pstFP@xp=15
\countdef\pstFP@xq=16
\countdef\pstFP@xr=17
\countdef\pstFP@xz=18
\countdef\pstFP@xt=19
\countdef\pstFP@xu=20
\countdef\pstFP@xv=21

\countdef\pstFP@yk=22 %registers for splitting 2nd value
\countdef\pstFP@yl=23
\countdef\pstFP@ym=24
\countdef\pstFP@yn=25
\countdef\pstFP@yo=26
\countdef\pstFP@yp=27
\countdef\pstFP@yq=28
\countdef\pstFP@yr=29
\countdef\pstFP@yz=30
\countdef\pstFP@yt=31
\countdef\pstFP@yu=32
\countdef\pstFP@yv=33

\newcount\pstFP@rega   %auxiliary registers
\newcount\pstFP@regb
\countdef\pstFP@regc=36
\countdef\pstFP@regd=37
\countdef\pstFP@rege=38

\countdef\pstFP@rs=39 %result registers
\countdef\pstFP@ria=40
\countdef\pstFP@rib=41
\countdef\pstFP@rfa=42
\countdef\pstFP@rfb=43

\newcount\pstFP@regs    %local auxiliary registers
\countdef\pstFP@count=45
\countdef\pstFP@res=46
\countdef\pstFP@shift=47
\newcount\pstFP@times

%auxiliary macros which may be used in all of the following macros
\newif\ifpstFP@test

\def\pstFP@ignorenext#1{}
\def\pstFP@first#1#2\relax{#1}
\def\pstFP@swallow#1\relax{}
%
\def\ifpstFP@zero#1{%
  \ifnum%
    \expandafter\ifnum\csname pstFP@#1ia\endcsname=0 0\else1\fi%
    \expandafter\ifnum\csname pstFP@#1ib\endcsname=0 0\else1\fi%
    \expandafter\ifnum\csname pstFP@#1fa\endcsname=0 0\else1\fi%
    \expandafter\ifnum\csname pstFP@#1fb\endcsname=0 0\else1\fi%
    =0\relax%
}
%
%read value
%
\def\pstFP@correctintcounter#1\relax{%
  {\edef\pstFP@tmp{#1}%
   \pstFP@count=0\relax%
   \loop%
     \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}%
     \expandafter\ifx\pstFP@tmpa0\relax%
        \advance\pstFP@count1\relax%
        \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}%
     \repeat%
   \ifnum\pstFP@count>18\relax%
     \typeout{>>>> Overflow}%
   \fi%
   \expandafter\if!\pstFP@tmp!%
     \advance\pstFP@count-18\relax%
     \pstFP@count=-\pstFP@count%
     \loop%
       \ifnum\pstFP@count>0\relax%
          \pstFP@regc=\pstFP@rega%
	  \divide\pstFP@rega10\relax\multiply\pstFP@rega10\relax%
	  \advance\pstFP@regc-\pstFP@rega\multiply\pstFP@regc100000000\relax%
	  \divide\pstFP@rega10\relax%
	  \divide\pstFP@regb10\relax\advance\pstFP@regb\pstFP@regc%
	  \advance\pstFP@count-1\relax%
       \repeat%
     \global\pstFP@rega=\pstFP@rega%
     \global\pstFP@regb=\pstFP@regb%
   \else%
     \typeout{>>>>Number too big}%
   \fi%
  }%
}
\def\pstFP@@setintcounter#1#2#3#4#5#6#7#8#9{%
  \pstFP@regb=#1#2#3#4#5#6#7#8#9\relax%
  \pstFP@correctintcounter%
}
\def\pstFP@setintcounter#1#2#3#4#5#6#7#8#9{%
  \pstFP@rega=#1#2#3#4#5#6#7#8#9\relax%
  \pstFP@@setintcounter%
}

\def\pstFP@@setfractcounter#1#2#3#4#5#6#7#8#9{%
  \pstFP@regb=#1#2#3#4#5#6#7#8#9\relax%
  \pstFP@swallow%
}
\def\pstFP@setfractcounter#1#2#3#4#5#6#7#8#9{%
  \pstFP@rega=#1#2#3#4#5#6#7#8#9\relax%
  \pstFP@@setfractcounter%
}

\def\pstFP@getsign#1\relax{%
  {\pstFP@regs=1\relax%
   \edef\pstFP@tmp{#1}%
   \loop%
     \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}%
     \expandafter\ifx\pstFP@tmpa-\relax%
        \multiply\pstFP@regs-1\relax%
     \fi%
     \ifnum\expandafter\ifx\pstFP@tmpa-1\else0\fi\expandafter\ifx\pstFP@tmpa+1\else0\fi>0%
        \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}%
     \repeat%
   \global\let\pstFP@tmp\pstFP@tmp%
   \global\pstFP@regs=\pstFP@regs%
  }%
}

\def\pstFP@removeleadingzeros#1\relax{%
  {\edef\pstFP@tmp{#1}%
   \loop%
     \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}%
     \expandafter\ifx\pstFP@tmpa0\relax%
       \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}%
     \repeat%
   \global\let\pstFP@tmp\pstFP@tmp%
  }%
}

\newif\ifpstFP@nonstop
\def\pstFP@strip#1{%
  {\edef\pstFP@tmp{#1}%
   \edef\pstFP@tmpb{}%
   \ifx\pstFP@tmp\@empty\else%
     \pstFP@nonstoptrue%
     \loop%
       \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}%
       \expandafter\ifx\pstFP@tmpa-\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa+\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa0\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa1\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa2\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa3\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa4\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa5\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa6\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa7\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa8\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \expandafter\ifx\pstFP@tmpa9\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else%
       \ifx\pstFP@tmpa\@empty\pstFP@nonstopfalse\else%
       \ifx\pstFP@tmpa\space\pstFP@nonstopfalse\else%
         \typeout{>>> Illegal character \pstFP@tmpa\space found in float number}%
       \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
       \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}%
       \ifx\pstFP@tmp\@empty\pstFP@nonstopfalse\fi%
       \ifpstFP@nonstop%
       \repeat%
   \fi%
   \global\let\pstFP@tmp\pstFP@tmpb%
  }%
}

\def\pstFP@readvalue#1#2#3{%
  % #1    macro family to catch the value
  % #2.#3 value
  %
  % regular expression [+|-]*[d]_0^18.[d]*
  %
  \pstFP@strip{#2}%
  %sign
  \expandafter\pstFP@getsign\pstFP@tmp\relax%
  \csname pstFP@#1s\endcsname=\pstFP@regs%
  %
  %integer part
  \pstFP@removeleadingzeros\pstFP@tmp\relax%
  \expandafter\pstFP@setintcounter\pstFP@tmp000000000000000000\relax%
  \csname pstFP@#1ia\endcsname=\pstFP@rega%
  \csname pstFP@#1ib\endcsname=\pstFP@regb%
  %
  %fractional part
  \pstFP@strip{#3}%
  \expandafter\pstFP@setfractcounter\pstFP@tmp000000000000000000\relax%
  \csname pstFP@#1fa\endcsname=\pstFP@rega%
  \csname pstFP@#1fb\endcsname=\pstFP@regb%
  %
  %correct sign
  \ifnum\pstFP@rega=0\relax%
    \ifnum\pstFP@regb=0\relax%
      \expandafter\ifnum\csname pstFP@#1ib\endcsname=0\relax%
        \expandafter\ifnum\csname pstFP@#1ia\endcsname=0\relax%
	  \csname pstFP@#1s\endcsname=1\relax%
	\fi%
      \fi%
    \fi%
  \fi%
}
%
%store value in macro
%
\def\pstFP@store#1#2{%
  % #1 macro
  % #2 macro family (value) to store
  %
  \ifpstFP@zero{#2}%
    \csname pstFP@#2s\endcsname=1\relax%
  \fi%
  \expandafter\ifnum\csname pstFP@#2s\endcsname<0\relax%
    \edef#1{-}%
  \else%
    \edef#1{}%
  \fi%
  \expandafter\ifnum\csname pstFP@#2ia\endcsname=0\relax%
     \expandafter\ifnum\csname pstFP@#2ib\endcsname=0\relax%
       \edef#1{#10}%
     \else%
       \edef#1{#1\expandafter\the\csname pstFP@#2ib\endcsname}%
     \fi%
  \else%
    \expandafter\advance\csname pstFP@#2ib\endcsname1000000000\relax%
    \edef#1{#1\expandafter\the\csname pstFP@#2ia\endcsname\expandafter\pstFP@ignorenext\the\csname pstFP@#2ib\endcsname}%
  \fi%
  \expandafter\advance\csname pstFP@#2fa\endcsname1000000000\relax%
  \expandafter\advance\csname pstFP@#2fb\endcsname1000000000\relax%
  \edef#1{#1\noexpand.\expandafter\pstFP@ignorenext\the\csname pstFP@#2fa\endcsname\expandafter\pstFP@ignorenext\the\csname pstFP@#2fb\endcsname}%
}
%macros to expand some arguments
%
\def\pstFP@callc#1#2#3#4{%
  % #1 macro to call
  % #2 macro, which gets the result
  % #3 1st value
  % #4 2nd value
  % expand the values and split them into the integer and the fractional parts
  \edef\next{\noexpand#1\noexpand#2#3..\noexpand\relax#4..\noexpand\relax}%
  \next%
}
%
\def\pstFP@divten#1{%
  \expandafter\pstFP@regc\csname pstFP@#1ia\endcsname%
  \expandafter\divide\csname pstFP@#1ia\endcsname10\relax%
  \expandafter\pstFP@regb\csname pstFP@#1ia\endcsname%
  \multiply\pstFP@regb10\relax%
  \advance\pstFP@regc-\pstFP@regb%
  \multiply\pstFP@regc100000000\relax%
  %
  \expandafter\pstFP@rega\csname pstFP@#1ib\endcsname%
  \expandafter\divide\csname pstFP@#1ib\endcsname10\relax%
  \expandafter\pstFP@regb\csname pstFP@#1ib\endcsname%
  \multiply\pstFP@regb10\relax%
  \advance\pstFP@rega-\pstFP@regb%
  \multiply\pstFP@rega100000000\relax%
  \expandafter\advance\csname pstFP@#1ib\endcsname\pstFP@regc%
  %
  \expandafter\pstFP@regc\csname pstFP@#1fa\endcsname%
  \expandafter\divide\csname pstFP@#1fa\endcsname10\relax%
  \expandafter\pstFP@regb\csname pstFP@#1fa\endcsname%
  \multiply\pstFP@regb10\relax%
  \advance\pstFP@regc-\pstFP@regb%
  \multiply\pstFP@regc100000000\relax%
  \expandafter\advance\csname pstFP@#1fa\endcsname\pstFP@rega%
  %
  \expandafter\divide\csname pstFP@#1fb\endcsname10\relax%
  \expandafter\advance\csname pstFP@#1fb\endcsname\pstFP@regc%
}
%
\def\pstFP@multen#1{%
  \expandafter\multiply\csname pstFP@#1ia\endcsname10\relax%
  \expandafter\ifnum\csname pstFP@#1ib\endcsname<100000000\relax%
  \else%
    \expandafter\pstFP@regc\csname pstFP@#1ib\endcsname%
    \divide\pstFP@regc100000000%
    \expandafter\advance\csname pstFP@#1ia\endcsname\pstFP@regc%
    \multiply\pstFP@regc100000000%
    \expandafter\advance\csname pstFP@#1ib\endcsname-\pstFP@regc%
  \fi%
  \expandafter\multiply\csname pstFP@#1ib\endcsname10\relax%
  \expandafter\ifnum\csname pstFP@#1fa\endcsname<100000000\relax%
  \else%
    \expandafter\pstFP@regc\csname pstFP@#1fa\endcsname%
    \divide\pstFP@regc100000000%
    \expandafter\advance\csname pstFP@#1ib\endcsname\pstFP@regc%
    \multiply\pstFP@regc100000000%
    \expandafter\advance\csname pstFP@#1fa\endcsname-\pstFP@regc%
  \fi%
  \expandafter\multiply\csname pstFP@#1fa\endcsname10\relax%
  \expandafter\ifnum\csname pstFP@#1fb\endcsname<100000000\relax%
  \else%
    \expandafter\pstFP@regc\csname pstFP@#1fb\endcsname%
    \divide\pstFP@regc100000000%
    \expandafter\advance\csname pstFP@#1fa\endcsname\pstFP@regc%
    \multiply\pstFP@regc100000000%
    \expandafter\advance\csname pstFP@#1fb\endcsname-\pstFP@regc%
  \fi%
  \expandafter\multiply\csname pstFP@#1fb\endcsname10\relax%
}
%
\def\pstFP@counttimes{%
  {\global\pstFP@times=0\relax%
   \loop%
     \ifnum%
        \ifnum\pstFP@xia>\pstFP@yia1%
	\else\ifnum\pstFP@xia<\pstFP@yia0%
	\else%
	  \ifnum\pstFP@xib>\pstFP@yib1%
	  \else\ifnum\pstFP@xib<\pstFP@yib0%
	  \else%
	    \ifnum\pstFP@xfa>\pstFP@yfa1%
	    \else\ifnum\pstFP@xfa<\pstFP@yfa0%
	    \else%
	      \ifnum\pstFP@xfb>\pstFP@yfb1%
	      \else\ifnum\pstFP@xfb<\pstFP@yfb0%
	      \else%
	         1%
	      \fi\fi%
	    \fi\fi%
	  \fi\fi%
	\fi\fi%
	=1\relax%
       \global\advance\pstFP@times1\relax%
       \global\advance\pstFP@xfb-\pstFP@yfb%
       \ifnum\pstFP@xfb<0\relax%
         \global\advance\pstFP@xfb1000000000\relax%
	 \global\advance\pstFP@xfa-1\relax%
       \fi%
       \global\advance\pstFP@xfa-\pstFP@yfa%
       \ifnum\pstFP@xfa<0\relax%
         \global\advance\pstFP@xfa1000000000\relax%
	 \global\advance\pstFP@xib-1\relax%
       \fi%
       \global\advance\pstFP@xib-\pstFP@yib%
       \ifnum\pstFP@xib<0\relax%
         \global\advance\pstFP@xib1000000000\relax%
	 \global\advance\pstFP@xia-1\relax%
       \fi%
       \global\advance\pstFP@xia-\pstFP@yia%
     \repeat%
  }%
}
%
\def\pstFP@div#1#2.#3.#4\relax#5.#6.#7\relax{%
  % #1 macro, which gets the result
  % #2 integer part of 1st value 
  % #3 fractional part of 1st value
  % #4 dummy to swallow everthing after the 2nd '.'
  % #5 integer part of 2nd value 
  % #6 fractional part of 2nd value
  % #7 dummy to swallow everthing after the 2nd '.'
  %
  % algorithmic idea (for x>0, y>0)
  %   - %determine \pstFP@shift  such that y*10^\pstFP@shift <100000000<=y*10^(\pstFP@shift+1)
  %   - %determine \pstFP@shift' such that x*10^\pstFP@shift'<100000000<=x*10^(\pstFP@shift+1)
  %   - x=x*\pstFP@shift'
  %   - y=y*\pstFP@shift
  %   - \pstFP@shift=\pstFP@shift-\pstFP@shift'
  %   - res=0
  %   - while y>0 %fixed-point representation!
  %   -   \pstFP@times=0
  %   -	  while x>y
  %   -     \pstFP@times=\pstFP@times+1
  %   -     x=x-y
  %   -   end
  %   -   y=y/10
  %   -   res=10*res+\pstFP@times/1000000000
  %   - end
  %   - %shift the result according to \pstFP@shift
  %
  {\pstFP@readvalue{x}{#2}{#3}%
   \pstFP@readvalue{y}{#5}{#6}%
   %
   %sign
   \multiply\pstFP@xs\pstFP@ys%
   \pstFP@rs=\pstFP@xs%
   %
   %compute division
   \ifpstFP@zero{y}%
     \typeout{>>>>Division by zero}%
   \else%
     \ifpstFP@zero{x}\def\next##1{\edef\pstFP@tmp{0}}\else\def\next##1{##1}\fi%
     \next%
       {\pstFP@shift=0\relax%
        \loop%
          \ifnum\pstFP@yia<100000000\relax%
	     \pstFP@multen{y}%
	     \advance\pstFP@shift1\relax%
	   \repeat%
        \loop%
          \ifnum\pstFP@xia<100000000\relax%
	     \pstFP@multen{x}%
	     \advance\pstFP@shift-1\relax%
	  \repeat%
        \pstFP@ria=0\pstFP@rib=0\pstFP@rfa=0\pstFP@rfb=0\relax%
        \loop%
          \ifpstFP@zero{y}\else%
	     \pstFP@counttimes%divides x by \pstFP@times*y
	     \pstFP@divten{y}%
	     \pstFP@multen{r}%
	     \advance\pstFP@rfb\pstFP@times%
	     \ifnum\pstFP@rfb<1000000000\relax\else%
	       \advance\pstFP@rfa1\advance\pstFP@rfb-1000000000\relax%
	       \ifnum\pstFP@rfa<1000000000\relax\else%
	         \advance\pstFP@rib1\advance\pstFP@rfa-1000000000\relax%
		 \ifnum\pstFP@rib<1000000000\relax\else%
		   \advance\pstFP@ria1\advance\pstFP@rib-1000000000\relax%
		 \fi%
	       \fi%
	     \fi%
	  \repeat%
        \loop%
          \ifnum\pstFP@shift>17%
	    \advance\pstFP@shift-1\relax%
	    \ifnum\pstFP@ria<100000000\else\pstFP@ria=-1\fi%
	    \ifnum\pstFP@ria<0\pstFP@ria=-1\fi%
	    \pstFP@multen{r}%
	  \repeat%
        \ifnum\pstFP@ria<1000000000\else\pstFP@ria=-1\fi%
        \loop%
          \ifnum\pstFP@shift<17%
	    \advance\pstFP@shift1\relax%
	    \pstFP@divten{r}%
	  \repeat%
        \ifnum\pstFP@ria<0\relax%
          \typeout{>>>>Overflow}%
        \else%
          \pstFP@store\pstFP@tmp{r}%
        \fi%
       }%
    \fi%
   %
   \global\let\pstFP@tmp=\pstFP@tmp%
   %
  }%
  \let#1\pstFP@tmp%
}
%
\catcode`\@=\PstAtCode\relax
%
%% END: pst-fp.tex
\endinput