# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by (C) Jim Thomas <jimthomas@hpcll218> on Tue Nov  5 16:12:13 1996
#
# This archive contains:
#	type_generic_math.ps	
#

LANG=""; export LANG
PATH=/bin:/usr/bin:$PATH; export PATH

echo x - type_generic_math.ps
sed 's/^@//' >type_generic_math.ps <<'@EOF'
%!PS-Adobe-3.0
%%Title: (Microsoft Word - type-generic\311)
%%Creator: (Microsoft Word: PSPrinter 8.1.1)
%%CreationDate: (4:08 PM Tuesday, November 5, 1996)
%%For: ()
%%Pages: 5
%%DocumentFonts: Times-Roman Times-Bold Times-Italic Courier-Bold Courier-BoldOblique
%%DocumentNeededFonts: Times-Roman Times-Bold Times-Italic Courier-Bold Courier-BoldOblique
%%DocumentSuppliedFonts:
%%DocumentData: Clean7Bit
%%PageOrder: Ascend
%%Orientation: Portrait
%ADO_PaperArea: -31 -30 761 582
%ADO_ImageableArea: 0 0 730 552
%%EndComments
/md 183 dict def md begin
/currentpacking where {pop /sc_oldpacking currentpacking def true setpacking}if
%%BeginFile: adobe_psp_basic
%%Copyright: Copyright 1990-1993 Adobe Systems Incorporated. All Rights Reserved.
/bd{bind def}bind def
/xdf{exch def}bd
/xs{exch store}bd
/ld{load def}bd
/Z{0 def}bd
/T/true
/F/false
/:L/lineto
/lw/setlinewidth
/:M/moveto
/rl/rlineto
/rm/rmoveto
/:C/curveto
/:T/translate
/:K/closepath
/:mf/makefont
/gS/gsave
/gR/grestore
/np/newpath
14{ld}repeat
/$m matrix def
/av 81 def
/por true def
/normland false def
/psb-nosave{}bd
/pse-nosave{}bd
/us Z
/psb{/us save store}bd
/pse{us restore}bd
/level2
/languagelevel where
{
pop languagelevel 2 ge
}{
false
}ifelse
def
/featurecleanup
{
stopped
cleartomark
countdictstack exch sub dup 0 gt
{
{end}repeat
}{
pop
}ifelse
}bd
/noload Z
/startnoload
{
{/noload save store}if
}bd
/endnoload
{
{noload restore}if
}bd
level2 startnoload
/setjob
{
statusdict/jobname 3 -1 roll put
}bd
/setcopies
{
userdict/#copies 3 -1 roll put
}bd
level2 endnoload level2 not startnoload
/setjob
{
1 dict begin/JobName xdf currentdict end setuserparams
}bd
/setcopies
{
1 dict begin/NumCopies xdf currentdict end setpagedevice
}bd
level2 not endnoload
/pm Z
/mT Z
/sD Z
/realshowpage Z
/initializepage
{
/pm save store mT concat
}bd
/endp
{
pm restore showpage
}def
/$c/DeviceRGB def
/rectclip where
{
pop/rC/rectclip ld
}{
/rC
{
np 4 2 roll
:M
1 index 0 rl
0 exch rl
neg 0 rl
:K
clip np
}bd
}ifelse
/rectfill where
{
pop/rF/rectfill ld
}{
/rF
{
gS
np
4 2 roll
:M
1 index 0 rl
0 exch rl
neg 0 rl
fill
gR
}bd
}ifelse
/rectstroke where
{
pop/rS/rectstroke ld
}{
/rS
{
gS
np
4 2 roll
:M
1 index 0 rl
0 exch rl
neg 0 rl
:K
stroke
gR
}bd
}ifelse
%%EndFile
%%BeginFile: adobe_psp_colorspace_level1
%%Copyright: Copyright 1991-1993 Adobe Systems Incorporated. All Rights Reserved.
/G/setgray ld
/:F/setrgbcolor ld
%%EndFile
%%BeginFile: adobe_psp_uniform_graphics
%%Copyright: Copyright 1990-1993 Adobe Systems Incorporated. All Rights Reserved.
/@a
{
np :M 0 rl :L 0 exch rl 0 rl :L fill
}bd
/@b
{
np :M 0 rl 0 exch rl :L 0 rl 0 exch rl fill
}bd
/arct where
{
pop
}{
/arct
{
arcto pop pop pop pop
}bd
}ifelse
/x1 Z
/x2 Z
/y1 Z
/y2 Z
/rad Z
/@q
{
/rad xs
/y2 xs
/x2 xs
/y1 xs
/x1 xs
np
x2 x1 add 2 div y1 :M
x2 y1 x2 y2 rad arct
x2 y2 x1 y2 rad arct
x1 y2 x1 y1 rad arct
x1 y1 x2 y1 rad arct
fill
}bd
/@s
{
/rad xs
/y2 xs
/x2 xs
/y1 xs
/x1 xs
np
x2 x1 add 2 div y1 :M
x2 y1 x2 y2 rad arct
x2 y2 x1 y2 rad arct
x1 y2 x1 y1 rad arct
x1 y1 x2 y1 rad arct
:K
stroke
}bd
/@i
{
np 0 360 arc fill
}bd
/@j
{
gS
np
:T
scale
0 0 .5 0 360 arc
fill
gR
}bd
/@e
{
np
0 360 arc
:K
stroke
}bd
/@f
{
np
$m currentmatrix
pop
:T
scale
0 0 .5 0 360 arc
:K
$m setmatrix
stroke
}bd
/@k
{
gS
np
:T
0 0 :M
0 0 5 2 roll
arc fill
gR
}bd
/@l
{
gS
np
:T
0 0 :M
scale
0 0 .5 5 -2 roll arc
fill
gR
}bd
/@m
{
np
arc
stroke
}bd
/@n
{
np
$m currentmatrix
pop
:T
scale
0 0 .5 5 -2 roll arc
$m setmatrix
stroke
}bd
%%EndFile
%%BeginFile: adobe_psp_basic_text
%%Copyright: Copyright 1990-1993 Adobe Systems Incorporated. All Rights Reserved.
/S/show ld
/A{
0.0 exch ashow
}bd
/R{
0.0 exch 32 exch widthshow
}bd
/W{
0.0 3 1 roll widthshow
}bd
/J{
0.0 32 4 2 roll 0.0 exch awidthshow
}bd
/V{
0.0 4 1 roll 0.0 exch awidthshow
}bd
/fcflg true def
/fc{
fcflg{
vmstatus exch sub 50000 lt{
(%%[ Warning: Running out of memory ]%%\r)print flush/fcflg false store
}if pop
}if
}bd
/$f[1 0 0 -1 0 0]def
/:ff{$f :mf}bd
/MacEncoding StandardEncoding 256 array copy def
MacEncoding 39/quotesingle put
MacEncoding 96/grave put
/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute
/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave
/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute
/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis
/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
/registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash
/infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation
/product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash
/questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft
/guillemotright/ellipsis/space/Agrave/Atilde/Otilde/OE/oe
/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge
/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl
/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave
/Oacute/Ocircumflex/apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde
/macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron
MacEncoding 128 128 getinterval astore pop
level2 startnoload
/copyfontdict
{
findfont dup length dict
begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
}bd
level2 endnoload level2 not startnoload
/copyfontdict
{
findfont dup length dict
copy
begin
}bd
level2 not endnoload
md/fontname known not{
/fontname/customfont def
}if
/Encoding Z
/:mre
{
copyfontdict
/Encoding MacEncoding def
fontname currentdict
end
definefont :ff def
}bd
/:bsr
{
copyfontdict
/Encoding Encoding 256 array copy def
Encoding dup
}bd
/pd{put dup}bd
/:esr
{
pop pop
fontname currentdict
end
definefont :ff def
}bd
/scf
{
scalefont def
}bd
/scf-non
{
$m scale :mf setfont
}bd
/ps Z
/fz{/ps xs}bd
/sf/setfont ld
/cF/currentfont ld
/mbf
{
/makeblendedfont where
{
pop
makeblendedfont
/ABlend exch definefont
}{
pop
}ifelse
def
}def
%%EndFile
%%BeginFile: adobe_psp_derived_styles
%%Copyright: Copyright 1990-1993 Adobe Systems Incorporated. All Rights Reserved.
/wi
version(23.0)eq
{
{
gS 0 0 0 0 rC stringwidth gR
}bind
}{
/stringwidth load
}ifelse
def
/$o 1. def
/gl{$o G}bd
/ms{:M S}bd
/condensedmtx[.82 0 0 1 0 0]def
/:mc
{
condensedmtx :mf def
}bd
/extendedmtx[1.18 0 0 1 0 0]def
/:me
{
extendedmtx :mf def
}bd
/basefont Z
/basefonto Z
/dxa Z
/dxb Z
/dxc Z
/dxd Z
/dsdx2 Z
/bfproc Z
/:fbase
{
dup/FontType get 0 eq{
dup length dict begin
dup{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall
/FDepVector exch/FDepVector get[exch/:fbase load forall]def
}/bfproc load ifelse
/customfont currentdict end definefont
}bd
/:mo
{
/bfproc{
dup dup length 2 add dict
begin
{
1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse
}forall
/PaintType 2 def
/StrokeWidth .012 0 FontMatrix idtransform pop def
/customfont currentdict
end
definefont
8 dict begin
/basefonto xdf
/basefont xdf
/FontType 3 def
/FontMatrix[1 0 0 1 0 0]def
/FontBBox[0 0 1 1]def
/Encoding StandardEncoding def
/BuildChar
{
exch begin
basefont setfont
( )dup 0 4 -1 roll put
dup wi
setcharwidth
0 0 :M
gS
gl
dup show
gR
basefonto setfont
show
end
}def
}store :fbase
}bd
/:mso
{
/bfproc{
7 dict begin
/basefont xdf
/FontType 3 def
/FontMatrix[1 0 0 1 0 0]def
/FontBBox[0 0 1 1]def
/Encoding StandardEncoding def
/BuildChar
{
exch begin
sD begin
/dxa 1 ps div def
basefont setfont
( )dup 0 4 -1 roll put
dup wi
1 index 0 ne
{
exch dxa add exch
}if
setcharwidth
dup 0 0 ms
dup dxa 0 ms
dup dxa dxa ms
dup 0 dxa ms
gl
dxa 2. div dup ms
end
end
}def
}store :fbase
}bd
/:ms
{
/bfproc{
dup dup length 2 add dict
begin
{
1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse
}forall
/PaintType 2 def
/StrokeWidth .012 0 FontMatrix idtransform pop def
/customfont currentdict
end
definefont
8 dict begin
/basefonto xdf
/basefont xdf
/FontType 3 def
/FontMatrix[1 0 0 1 0 0]def
/FontBBox[0 0 1 1]def
/Encoding StandardEncoding def
/BuildChar
{
exch begin
sD begin
/dxb .05 def
basefont setfont
( )dup 0 4 -1 roll put
dup wi
exch dup 0 ne
{
dxb add
}if
exch setcharwidth
dup dxb .01 add 0 ms
0 dxb :T
gS
gl
dup 0 0 ms
gR
basefonto setfont
0 0 ms
end
end
}def
}store :fbase
}bd
/:mss
{
/bfproc{
7 dict begin
/basefont xdf
/FontType 3 def
/FontMatrix[1 0 0 1 0 0]def
/FontBBox[0 0 1 1]def
/Encoding StandardEncoding def
/BuildChar
{
exch begin
sD begin
/dxc 1 ps div def
/dsdx2 .05 dxc 2 div add def
basefont setfont
( )dup 0 4 -1 roll put
dup wi
exch dup 0 ne
{
dsdx2 add
}if
exch setcharwidth
dup dsdx2 .01 add 0 ms
0 .05 dxc 2 div sub :T
dup 0 0 ms
dup dxc 0 ms
dup dxc dxc ms
dup 0 dxc ms
gl
dxc 2 div dup ms
end
end
}def
}store :fbase
}bd
/:msb
{
/bfproc{
7 dict begin
/basefont xdf
/FontType 3 def
/FontMatrix[1 0 0 1 0 0]def
/FontBBox[0 0 1 1]def
/Encoding StandardEncoding def
/BuildChar
{
exch begin
sD begin
/dxd .03 def
basefont setfont
( )dup 0 4 -1 roll put
dup wi
1 index 0 ne
{
exch dxd add exch
}if
setcharwidth
dup 0 0 ms
dup dxd 0 ms
dup dxd dxd ms
0 dxd ms
end
end
}def
}store :fbase
}bd
/italicmtx[1 0 -.212557 1 0 0]def
/:mi
{
italicmtx :mf def
}bd
/:v
{
[exch dup/FontMatrix get exch
dup/FontInfo known
{
/FontInfo get
dup/UnderlinePosition known
{
dup/UnderlinePosition get
2 index 0
3 1 roll
transform
exch pop
}{
@.1
}ifelse
3 1 roll
dup/UnderlineThickness known
{
/UnderlineThickness get
exch 0 3 1 roll
transform
exch pop
abs
}{
pop pop .067
}ifelse
}{
pop pop .1 .067
}ifelse
]
}bd
/$t Z
/$p Z
/$s Z
/:p
{
aload pop
2 index mul/$t xs
1 index mul/$p xs
@.012 mul/$s xs
}bd
/:m
{gS
0 $p rm
$t lw
0 rl stroke
gR
}bd
/:n
{
gS
0 $p rm
$t lw
0 rl
gS
gl
stroke
gR
strokepath
$s lw
/setstrokeadjust where{pop
currentstrokeadjust true setstrokeadjust stroke setstrokeadjust
}{
stroke
}ifelse
gR
}bd
/:o
{gS
0 $p rm
$t 2 div dup rm
$t lw
dup 0 rl
stroke
gR
:n
}bd
%%EndFile
/currentpacking where {pop sc_oldpacking setpacking}if
end		% md
%%EndProlog
%%BeginSetup
md begin
countdictstack
[
{%stopped
%%BeginFeature: *ManualFeed False
1 dict dup /ManualFeed false put setpagedevice
%%EndFeature
}featurecleanup
countdictstack
[
{%stopped
%%BeginFeature: *PageSize LetterSmall

    1 dict
    dup /Policies 2 dict dup /PageSize 2 put dup /MediaType 0 put put
	setpagedevice
	2 dict
    dup /PageSize [612 792] put
    dup /ImagingBBox null put
    setpagedevice
%%EndFeature
}featurecleanup
()setjob
/pT[1 0 0 -1 30 761]def/mT[1 0 0 -1 30 761]def
/sD 16 dict def
300 level2{1 dict dup/WaitTimeout 4 -1 roll put setuserparams}{statusdict/waittimeout 3 -1 roll put}ifelse
%%IncludeFont: Times-Roman
%%IncludeFont: Times-Bold
%%IncludeFont: Times-Italic
%%IncludeFont: Courier-Bold
%%IncludeFont: Courier-BoldOblique
/f0_1/Times-Roman :mre
/f0_12 f0_1 12 scf
/f0_10 f0_1 10 scf
/f0_9 f0_1 9 scf
/f0_5 f0_1 5 scf
/f1_1/Times-Bold :mre
/f1_18 f1_1 18 scf
/f1_14 f1_1 14 scf
/f1_12 f1_1 12 scf
/f2_1/Times-Italic :mre
/f2_12 f2_1 12 scf
/f2_10 f2_1 10 scf
/f3_1/Courier-Bold :mre
/f3_14 f3_1 14 scf
/f3_10 f3_1 10 scf
/f3_9 f3_1 9 scf
/f7_1/Courier-BoldOblique :mre
/f7_10 f7_1 10 scf
/Courier findfont[10 0 0 -10 0 0]:mf setfont
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
initializepage
(; page: 1 of 5)setjob
%%EndPageSetup
gS 0 0 552 730 rC
504 710 :M
f0_12 sf
(1)S
177 55 :M
f1_18 sf
-.036(Type-Generic Math Functions)A
182 80 :M
f1_12 sf
-.024(WG14/N618 X3J11/96-82    \(Draft 10/13/96\))A
264 104 :M
f0_12 sf
-.11(Jim Thomas)A
54 104 :M
(5)S
246 116 :M
f3_10 sf
(jthomas@best.com)S
78 157 :M
f1_12 sf
-.097(Synopsis)A
48 169 :M
f0_12 sf
(1)S
54 169 :M
(0)S
96 181 :M
2.044 .204(Type-generic macros allow calling a function whose type is determined by the)J
78 193 :M
@.313 .031(argument type, as is the case for C operators such as )J
338 193 :M
f3_10 sf
@.109(+)A
f0_12 sf
@.17 .017( and )J
f3_10 sf
@.109(*)A
f0_12 sf
@.277 .028(.  For example, with a type-)J
78 205 :M
@.408 .041(generic )J
118 205 :M
f3_10 sf
@.214(cos)A
f0_12 sf
@.628 .063( macro, the expression )J
f3_10 sf
@.214(cos\(\(float\)x\))A
f0_12 sf
@.471 .047( will have type )J
f3_10 sf
@.214(float)A
f0_12 sf
@.54 .054(.  This feature)J
78 217 :M
@.026 .003(enables writing more portably efficient code, and alleviates need for awkward casting and)J
78 229 :M
@.944 .094(suffixing in the process of porting or adjusting precision.  This is a proposal for type-)J
48 229 :M
(1)S
54 229 :M
(5)S
78 241 :M
@.414 .041(generic macros for most of the functions in )J
294 241 :M
f3_10 sf
@.058(<math.h>)A
f0_12 sf
@.093 .009( and )J
367 241 :M
f3_10 sf
@.059(<complex.h>)A
f0_12 sf
@.166 .017(.  The proposed)J
78 253 :M
(header )S
f3_10 sf
-.006(<generic_math.h>)A
f0_12 sf
-.005( includes the headers )A
313 253 :M
f3_10 sf
-.008(<math.h>)A
f0_12 sf
( and )S
f3_10 sf
-.008(<complex.h>)A
f0_12 sf
-.008( and extends)A
78 265 :M
-.006(them by defining the type-generic macros.)A
48 289 :M
(2)S
54 289 :M
(0)S
78 301 :M
f1_12 sf
-.038(Background)A
96 325 :M
f0_12 sf
@.064 .006(As recent as December 1995, the floating-point and complex arithmetic specifications)J
78 337 :M
@.204 .02(included type-generic macros, under the name of overloading macros.  Then, in response)J
78 349 :M
1.51 .151(to the wishes of the C committees, these specifications were redrafted removing the)J
48 349 :M
(2)S
54 349 :M
(5)S
78 361 :M
@.052 .005(overloading macros, with the intention of later considering them as a separate feature.  At)J
78 373 :M
1.537 .154(the Amsterdam meeting, the committees accepted in principle the floating-point and)J
78 385 :M
1.893 .189(complex arithmetic specifications \(sans overloading\) into the C9X draft;  and they)J
78 397 :M
@.514 .051(requested a newly written proposal for the extracted facility, but under a different name)J
78 409 :M
-.019(than overloading.  This document is that proposal.)A
48 409 :M
(3)S
54 409 :M
(0)S
78 445 :M
f1_12 sf
-.047(Proposal)A
96 469 :M
f0_12 sf
1.593 .159(Rationale given here pertains to this presentation of the type-generic feature.  It)J
48 469 :M
(3)S
54 469 :M
(5)S
78 481 :M
@.294 .029(supplements the rationale in the earlier specification for overloading, and is not intended)J
78 493 :M
-.006(as a complete rationale for the feature.)A
78 529 :M
f2_12 sf
-.036(In 7, insert this subclause:)A
48 529 :M
f0_12 sf
(4)S
54 529 :M
(0)S
78 564 :M
f1_18 sf
-.011(7.x  Type-generic math <generic_math.h>)A
96 595 :M
f0_12 sf
-.063(The header )A
153 595 :M
f3_10 sf
-.008(<generic_math.h>)A
f0_12 sf
-.006( includes the headers )A
353 595 :M
f3_10 sf
-.024(<math.h>)A
f0_12 sf
-.018( and )A
f3_10 sf
-.024(<complex.h>)A
f0_12 sf
-.027( and)A
78 607 :M
-.041(defines several )A
153 607 :M
f2_12 sf
-.014(type-generic macros)A
f0_12 sf
(.)S
48 607 :M
(4)S
54 607 :M
(5)S
114 631 :M
f0_10 sf
@.852 .085([The name )J
163 631 :M
f2_10 sf
-.088(type-generic)A
213 631 :M
f0_10 sf
@.934 .093( was chosen as more specific than the suggested name )J
447 631 :M
f2_10 sf
-.086(intrinsic)A
f0_10 sf
(,)S
114 642 :M
-.012(which already is widely used with a more general meaning.)A
114 664 :M
@.39 .039(The macros are placed in their own header in order not to silently break old programs that)J
48 664 :M
f0_12 sf
(5)S
54 664 :M
(0)S
114 675 :M
f0_10 sf
-.133(include )A
146 675 :M
f3_9 sf
-.271(<math.h>)A
f0_10 sf
-.196(, for example with  )A
f3_9 sf
-.271(printf\("%e", sin\(x\)\);)A
f0_10 sf
-.209( .])A
endp
%%Page: 2 2
%%BeginPageSetup
initializepage
(; page: 2 of 5)setjob
%%EndPageSetup
gS 0 0 552 730 rC
42 14 :M
f0_12 sf
-.032(WG14/N618 X3J11/96-82)A
431 14 :M
-.095(10/13/96)A
42 722 :M
(2)S
379 722 :M
-.059(Type-Generic Math)A
42 68 :M
f1_14 sf
-.022(7.x.1  Type-generic macros)A
60 95 :M
f0_12 sf
2.992 .299(Of the )J
f3_10 sf
1.454(<math.h>)A
f0_12 sf
2.356 .236( and )J
189 95 :M
f3_10 sf
@.892(<complex.h>)A
f0_12 sf
2.55 .255( functions without an )J
386 95 :M
f3_10 sf
1.717(f)A
f0_12 sf
1.669 .167( \()J
f3_10 sf
1.717(float)A
f0_12 sf
2.384 .238(\) or )J
468 95 :M
f3_10 sf
(l)S
42 107 :M
f0_12 sf
(\()S
46 107 :M
f3_10 sf
@.272(long\312double)A
f0_12 sf
@.92 .092(\) suffix, several have one or more parameters whose corresponding real)J
18 107 :M
(5)S
42 119 :M
@.866 .087(type is )J
80 119 :M
f3_10 sf
@.251(double)A
f0_12 sf
@.694 .069( and return a result whose corresponding real type is )J
383 119 :M
f3_10 sf
@.233(double)A
f0_12 sf
@.492 .049(.  For each)J
42 131 :M
@.915 .092(such function, except for )J
f3_10 sf
@.296(modf)A
f0_12 sf
@.461 .046( and )J
f3_10 sf
@.296(nextafterd)A
f0_12 sf
@.806 .081(, there is a corresponding )J
414 131 :M
f2_12 sf
-.087(type-generic)A
42 145 :M
-.164(macro)A
73 142 :M
f0_9 sf
(1)S
77 145 :M
f0_12 sf
2.127 .213(.  The parameters whose corresponding real type is )J
355 145 :M
f3_10 sf
@.552(double)A
f0_12 sf
1.492 .149( in the function)J
42 157 :M
2.819 .282(synopsis are )J
114 157 :M
f2_12 sf
1.618 .162(generic parameters)J
213 157 :M
f0_12 sf
3.264 .326(.  Use of the macro invokes a function whose)J
42 169 :M
@.074 .007(corresponding real type and type-domain are determined by the arguments for the generic)J
12 169 :M
(1)S
18 169 :M
(0)S
42 181 :M
-.063(parameters.)A
78 205 :M
f0_10 sf
-.22([)A
f3_9 sf
-.374(modf\(double, double*\))A
188 205 :M
f0_10 sf
@.726 .073( is excluded because no way was seen to make it safe without)J
78 216 :M
-.029(complicating the type resolution.])A
12 227 :M
f0_12 sf
(1)S
18 227 :M
(5)S
60 239 :M
-.01(Use of the macro invokes a function whose corresponding real type is the wider of)A
42 263 :M
(\321)S
60 263 :M
-.011(the corresponding real types of floating arguments for generic parameters)A
42 275 :M
(\321)S
60 275 :M
-.22(the )A
78 275 :M
f3_10 sf
-.073(float)A
f0_12 sf
-.072( type)A
12 287 :M
(2)S
18 287 :M
(0)S
78 299 :M
f0_10 sf
@.42 .042([This differs from the earlier overloading proposal in that the type is determined solely by)J
78 310 :M
@.577 .058(the argument, and may be narrower than the type for expression evaluation.  This change)J
78 321 :M
-.008(was made because the performance costs for computing functions with narrow arguments to)A
78 332 :M
1.91 .191(wide range and precision might be too high, even if the implementation efficiently)J
78 343 :M
-.013(evaluates basic operations to wide precision.])A
12 343 :M
f0_12 sf
(2)S
18 343 :M
(5)S
60 366 :M
3.185 .319(For each unsuffixed function in )J
f3_10 sf
1.016(<math.h>)A
f0_12 sf
2.505 .251( for which there is a function in)J
42 378 :M
f3_10 sf
@.155(<complex.h>)A
f0_12 sf
@.368 .037( with the same name except for a )J
f3_10 sf
@.155(c)A
f0_12 sf
@.619 .062( prefix, the corresponding type-generic)J
42 390 :M
2.015 .201(macro \(for both functions\) has the same name as the function in )J
f3_10 sf
@.719(<math.h>)A
f0_12 sf
1.326 .133(.  The)J
42 402 :M
-.016(corresponding type-generic macro for )A
227 402 :M
f3_10 sf
-.017(fabs)A
f0_12 sf
-.013( and )A
f3_10 sf
-.017(cabs)A
f0_12 sf
( is )S
f3_10 sf
-.017(fabs)A
f0_12 sf
(.)S
12 402 :M
(3)S
18 402 :M
(0)S
78 426 :M
f3_10 sf
(<math.h>)S
186 426 :M
(<complex.h>)S
294 426 :M
f0_12 sf
-.087(type-generic)A
78 438 :M
-.141(function)A
186 438 :M
-.141(function)A
294 438 :M
-.245(macro)A
78 450 :M
-.103(----------)A
186 450 :M
-.076(-------------)A
294 450 :M
-.135(--------)A
326 450 :M
-.159(-------)A
78 462 :M
f3_10 sf
(acos)S
186 462 :M
(cacos)S
294 462 :M
(acos)S
12 462 :M
f0_12 sf
(3)S
18 462 :M
(5)S
78 473 :M
f3_10 sf
(asin)S
186 473 :M
(casin)S
294 473 :M
(asin)S
78 484 :M
(atan)S
186 484 :M
(catan)S
294 484 :M
(atan)S
78 495 :M
(acosh)S
186 495 :M
(cacosh)S
294 495 :M
(acosh)S
78 506 :M
(asinh)S
186 506 :M
(casinh)S
294 506 :M
(asinh)S
78 517 :M
(atanh)S
186 517 :M
(catanh)S
294 517 :M
(atanh)S
12 517 :M
f0_12 sf
(4)S
18 517 :M
(0)S
78 528 :M
f3_10 sf
(cos)S
186 528 :M
(ccos)S
294 528 :M
(cos)S
78 539 :M
(sin)S
186 539 :M
(csin)S
294 539 :M
(sin)S
78 550 :M
(tan)S
186 550 :M
(ctan)S
294 550 :M
(tan)S
78 561 :M
(cosh)S
186 561 :M
(ccosh)S
294 561 :M
(cosh)S
78 572 :M
(sinh)S
186 572 :M
(csinh)S
294 572 :M
(sinh)S
12 572 :M
f0_12 sf
(4)S
18 572 :M
(5)S
78 583 :M
f3_10 sf
(tanh)S
186 583 :M
(ctanh)S
294 583 :M
(tanh)S
78 594 :M
(exp)S
186 594 :M
(cexp)S
294 594 :M
(exp)S
78 605 :M
(log)S
186 605 :M
(clog)S
294 605 :M
(log)S
78 616 :M
(pow)S
186 616 :M
(cpow)S
294 616 :M
(pow)S
78 627 :M
(sqrt)S
186 627 :M
(csqrt)S
294 627 :M
(sqrt)S
12 627 :M
f0_12 sf
(5)S
18 627 :M
(0)S
78 638 :M
f3_10 sf
(fabs)S
186 638 :M
(cabs)S
294 638 :M
(fabs)S
42 662 :M
f0_12 sf
(                                                )S
42 659.48 -.48 .48 186.48 659 .48 42 659 @a
42 673 :M
f0_9 sf
(1)S
46 676 :M
f0_10 sf
-.004(  Like other function-like macros in the Standard libraries, each type-generic macro can be suppressed to)A
42 687 :M
-.007(make available the corresponding ordinary function.)A
endp
%%Page: 3 3
%%BeginPageSetup
initializepage
(; page: 3 of 5)setjob
%%EndPageSetup
gS 0 0 552 730 rC
78 14 :M
f0_12 sf
-.075(Draft 10/13/96)A
382 14 :M
-.032(WG14/N618 X3J11/96-82)A
78 722 :M
-.059(Type-Generic Math)A
504 722 :M
(3)S
78 50 :M
1.712 .171(If at least one argument for a generic parameter is complex, then use of the macro)J
78 62 :M
-.002(invokes a complex function;  otherwise, use of the macro invokes a real function.)A
114 86 :M
1.077 .108(For each unsuffixed function in )J
278 86 :M
f3_10 sf
@.218(<math.h>)A
f0_12 sf
@.451 .045( without a )J
f3_10 sf
@.218(c)A
f0_12 sf
@.973 .097(-prefixed counter-part in)J
78 98 :M
f3_10 sf
@.111(<complex.h>)A
f0_12 sf
@.364 .036(, the corresponding type-generic macro has the same name as the function.)J
54 98 :M
(5)S
78 110 :M
-.032(These type-generic macros are)A
78 134 :M
( )S
114 134 :M
f3_10 sf
(atan2)S
114 145 :M
(exp2)S
114 156 :M
(expm1)S
57 156 :M
f0_12 sf
(1)S
63 156 :M
(0)S
114 167 :M
f3_10 sf
(frexp)S
114 178 :M
(ldexp)S
114 189 :M
(log10)S
114 200 :M
(log1p)S
114 211 :M
(log2)S
57 211 :M
f0_12 sf
(1)S
63 211 :M
(5)S
114 222 :M
f3_10 sf
(logb)S
114 233 :M
(scalb)S
270 134 :M
(hypot)S
270 145 :M
(erf)S
270 156 :M
(erfc)S
213 156 :M
f0_12 sf
(2)S
219 156 :M
(0)S
270 167 :M
f3_10 sf
(gamma)S
270 178 :M
(lgamma)S
270 189 :M
(ceil)S
270 200 :M
(floor)S
270 211 :M
(fmod)S
213 211 :M
f0_12 sf
(2)S
219 211 :M
(5)S
270 222 :M
f3_10 sf
(nearbyint)S
270 233 :M
(rint)S
426 134 :M
(round)S
426 145 :M
(trunc)S
426 156 :M
(remainder)S
369 156 :M
f0_12 sf
(3)S
375 156 :M
(0)S
426 167 :M
f3_10 sf
(remquo)S
426 178 :M
(copysign)S
426 189 :M
(nextafter)S
426 200 :M
(fdim)S
426 211 :M
(fmax)S
369 211 :M
f0_12 sf
(3)S
375 211 :M
(5)S
426 222 :M
f3_10 sf
(fmin)S
78 256 :M
f0_12 sf
@.355 .035(If at least one argument for a generic parameter is not real, then use of the macro results)J
78 268 :M
-.009(in implementation-defined behavior;  otherwise, use of the macro invokes a real function.)A
48 280 :M
(4)S
54 280 :M
(0)S
114 292 :M
f0_10 sf
@.67 .067([The intention here is to allow, but not require, extensions for complex versions of these)J
114 303 :M
@.353 .035(functions.  Alternatively, the implementation might just pass a complex argument to a real)J
114 314 :M
-.001(function, thereby converting the complex argument to real.])A
96 337 :M
f0_12 sf
@.339 .034(For each unsuffixed function in )J
f3_10 sf
@.108(<complex.h>)A
f0_12 sf
@.174 .017( that is not a )J
385 337 :M
f3_10 sf
@.052(c)A
f0_12 sf
@.233 .023(-prefixed counter-part to)J
48 337 :M
(4)S
54 337 :M
(5)S
78 349 :M
@.314 .031(a function in )J
144 349 :M
f3_10 sf
@.097(<math.h>)A
f0_12 sf
@.312 .031(, the corresponding type-generic macro has the same name as the)J
78 361 :M
-.023(function.  These type-generic macros are)A
114 385 :M
f3_10 sf
(carg)S
114 396 :M
(conj)S
57 396 :M
f0_12 sf
(5)S
63 396 :M
(0)S
270 385 :M
f3_10 sf
(cimag)S
270 396 :M
(cproj)S
426 385 :M
(creal)S
78 419 :M
f0_12 sf
-.014(Use of the macro with any real or complex arguments invokes a )A
388 419 :M
f3_10 sf
-.052(<complex.h>)A
f0_12 sf
-.044( function.)A
48 419 :M
(5)S
54 419 :M
(5)S
78 443 :M
f1_12 sf
-.142(Examples)A
96 467 :M
f0_12 sf
-.031(With the declarations)A
48 479 :M
(6)S
54 479 :M
(0)S
114 491 :M
f3_10 sf
(#include <generic_math.h>)S
114 502 :M
(int n;)S
114 513 :M
(float f;)S
114 524 :M
(double d;)S
114 535 :M
(long double ld;)S
48 535 :M
f0_12 sf
(6)S
54 535 :M
(5)S
114 546 :M
f3_10 sf
(float complex fc;)S
114 557 :M
(double complex dc;)S
114 568 :M
(long double complex ldc;)S
78 591 :M
f0_12 sf
-.008(functions invoked by use of type-generic macros are shown in the table:)A
48 591 :M
(7)S
54 591 :M
(0)S
96 615 :M
-.122(macro use)A
222 615 :M
-.054(invokes)A
96 627 :M
-.064(---------------)A
222 627 :M
-.083(------------)A
96 639 :M
f3_10 sf
(exp\(n\))S
222 639 :M
(expf\(n\))S
96 650 :M
(acosh\(f\))S
222 650 :M
(acoshf\(f\))S
48 650 :M
f0_12 sf
(7)S
54 650 :M
(5)S
96 661 :M
f3_10 sf
(sin\(d\))S
222 661 :M
-.038(sin\(d\))A
f0_12 sf
-.031(, the function)A
96 673 :M
f3_10 sf
(atan\(ld\))S
222 673 :M
(atanl\(ld\))S
96 684 :M
(log\(fc\))S
222 684 :M
(clogf\(fc\))S
endp
%%Page: 4 4
%%BeginPageSetup
initializepage
(; page: 4 of 5)setjob
%%EndPageSetup
gS 0 0 552 730 rC
42 14 :M
f0_12 sf
-.032(WG14/N618 X3J11/96-82)A
431 14 :M
-.095(10/13/96)A
42 722 :M
(4)S
379 722 :M
-.059(Type-Generic Math)A
60 50 :M
f3_10 sf
(sqrt\(dc\))S
186 50 :M
(csqrt\(dc\))S
60 61 :M
(pow\(ldc, f\))S
186 61 :M
(cpowl\(ldc, f\))S
60 72 :M
(remainder\(n, n\))S
186 72 :M
(remainderf\(n, n\))S
60 83 :M
(nextafter\(d, f\))S
186 83 :M
-.024(nextafter\(d, f\))A
f0_12 sf
-.02(, the function)A
60 95 :M
f3_10 sf
(copysign\(n, ld\))S
186 95 :M
(copysignl\(n, ld\))S
18 95 :M
f0_12 sf
(5)S
60 106 :M
f3_10 sf
(exp2\(fc\))S
186 106 :M
f0_12 sf
-.014(implementation-defined)A
60 118 :M
f3_10 sf
(fabs\(dc\))S
186 118 :M
f0_12 sf
-.014(implementation-defined)A
60 130 :M
f3_10 sf
(gamma\(ldc\))S
186 130 :M
f0_12 sf
-.014(implementation-defined)A
60 142 :M
f3_10 sf
(carg\(n\))S
186 142 :M
(cargf\(n\))S
60 153 :M
(cproj\(f\))S
186 153 :M
(cprojf\(f\))S
12 153 :M
f0_12 sf
(1)S
18 153 :M
(0)S
60 164 :M
f3_10 sf
(creal\(d\))S
186 164 :M
-.034(creal\(d\))A
f0_12 sf
-.028(, the function)A
60 176 :M
f3_10 sf
(cimag\(ld\))S
186 176 :M
(cimagl\(ld\))S
60 187 :M
(cabs\(fc\))S
186 187 :M
(cabsf\(fc\))S
60 198 :M
(carg\(dc\))S
186 198 :M
-.034(carg\(dc\))A
f0_12 sf
-.028(, the function)A
60 210 :M
f3_10 sf
(cproj\(ldc\))S
186 210 :M
(cprojl\(ldc\))S
12 210 :M
f0_12 sf
(1)S
18 210 :M
(5)S
42 257 :M
f2_12 sf
-.007(Replace 7.x.11.3 in the floating-point document \(N595\) with the following \(footnote 14 is)A
42 269 :M
-.027(already in the floating-point spec\):)A
12 269 :M
f0_12 sf
(2)S
18 269 :M
(0)S
78 293 :M
f0_10 sf
-.051([This is essentially the )A
f3_9 sf
-.074(nextafter)A
f0_10 sf
-.054( spec prior to the extraction of overloading.])A
42 316 :M
f1_12 sf
-.009(7.x.11.3  The )A
f3_10 sf
-.011(nextafter)A
f1_12 sf
-.01( functions)A
12 328 :M
f0_12 sf
(2)S
18 328 :M
(5)S
42 340 :M
f1_12 sf
-.097(Synopsis)A
78 364 :M
f3_10 sf
(#include <math.h>)S
78 375 :M
(double)S
f7_10 sf
( )S
f3_10 sf
(nextafter\(double)S
f7_10 sf
( )S
f3_10 sf
(x, long double y\);)S
78 386 :M
(float nextafterf\(float x, float y\);)S
12 386 :M
f0_12 sf
(3)S
18 386 :M
(0)S
78 397 :M
f3_10 sf
(double nextafterd\(double x, double y\);)S
78 408 :M
(long double nextafterl\(long double x, long double y\);)S
42 431 :M
f1_12 sf
-.031(Description)A
12 443 :M
f0_12 sf
(3)S
18 443 :M
(5)S
60 455 :M
@.264 .026(The )J
83 455 :M
f3_10 sf
@.22(nextafter)A
f0_12 sf
@.665 .067( function determines the next representable value, in the type of the)J
42 467 :M
(function, after )S
114 467 :M
f3_10 sf
@.139(x)A
f0_12 sf
@.299 .03( in the direction of )J
f3_10 sf
@.139(y)A
f0_12 sf
@.332 .033(, where x and y are first converted to the type of the)J
42 479 :M
-.123(function.)A
85 475 :M
f0_5 sf
-.05(14)A
f0_12 sf
0 4 rm
-.111(  The )A
0 -4 rm
118 479 :M
f3_10 sf
-.019(nextafter)A
f0_12 sf
-.014( function returns )A
f3_10 sf
(y)S
f0_12 sf
( if )S
f3_10 sf
-.019(x\312==\312y)A
f0_12 sf
(.)S
60 503 :M
1.546 .155(The functions )J
f3_10 sf
@.455(nextafterf)A
f0_12 sf
@.379 .038(, )J
f3_10 sf
@.455(nextafterd)A
f0_12 sf
@.768 .077(, and )J
f3_10 sf
@.455(nextafterl)A
f0_12 sf
1.077 .108( each is similar to the)J
12 503 :M
(4)S
18 503 :M
(0)S
42 515 :M
f3_10 sf
@.069(nextafter)A
f0_12 sf
@.193 .019( function except the type for both parameters and the returned value is )J
441 515 :M
f3_10 sf
(float)S
f0_12 sf
(,)S
42 527 :M
f3_10 sf
-.107(double)A
f0_12 sf
-.085(, or )A
97 527 :M
f3_10 sf
-.043(long\312double)A
f0_12 sf
-.034(, respectively.)A
42 551 :M
f1_12 sf
-.053(Returns)A
12 563 :M
f0_12 sf
(4)S
18 563 :M
(5)S
60 575 :M
@.492 .049(The functions )J
f3_10 sf
@.145(nextafter)A
f0_12 sf
@.121 .012(, )J
f3_10 sf
@.145(nextafterf)A
f0_12 sf
@.132 .013(, )J
261 575 :M
f3_10 sf
@.156(nextafterd)A
f0_12 sf
@.264 .026(, and )J
f3_10 sf
@.156(nextafterl)A
f0_12 sf
@.499 .05( each returns)J
42 587 :M
-.009(the next representable value in the specified format after )A
316 587 :M
f3_10 sf
(x)S
f0_12 sf
-.03( in the direction of )A
414 587 :M
f3_10 sf
(y)S
f0_12 sf
(.)S
42 623 :M
f2_12 sf
-.003(In the Annex Y:  IEC 559-Compatible Complex Arithmetic, append the subclause:)A
12 623 :M
f0_12 sf
(5)S
18 623 :M
(0)S
endp
%%Page: 5 5
%%BeginPageSetup
initializepage
(; page: 5 of 5)setjob
%%EndPageSetup
gS 0 0 552 730 rC
78 14 :M
f0_12 sf
-.075(Draft 10/13/96)A
382 14 :M
-.032(WG14/N618 X3J11/96-82)A
78 722 :M
-.059(Type-Generic Math)A
504 722 :M
(5)S
78 55 :M
f1_18 sf
-.287(Y.7  )A
f3_14 sf
-.362(<generic_math.h>)A
96 83 :M
f0_12 sf
3.523 .352(Type-generic macros that accept complex arguments also accept imaginary)J
78 95 :M
@.2 .02(arguments.  If an argument is imaginary, the macro expands to an expression whose type)J
78 107 :M
@.181 .018(is real, imaginary, or complex, as appropriate for the particular function:  if the argument)J
54 107 :M
(5)S
78 119 :M
@.518 .052(is imaginary, then the types of )J
232 119 :M
f3_10 sf
(cos)S
f0_12 sf
(, )S
257 119 :M
f3_10 sf
(cosh)S
f0_12 sf
(, )S
288 119 :M
f3_10 sf
(fabs)S
f0_12 sf
(, )S
319 119 :M
f3_10 sf
(carg)S
f0_12 sf
(, )S
350 119 :M
f3_10 sf
@.077(cimag)A
f0_12 sf
@.213 .021(, and)J
403 119 :M
f3_10 sf
@.388 .039( creal )J
447 119 :M
f0_12 sf
@.554 .055(are real;  the)J
78 131 :M
@.804 .08(types of )J
f3_10 sf
@.338(sin)A
f0_12 sf
@.308 .031(, )J
148 131 :M
f3_10 sf
@.223(tan)A
f0_12 sf
@.186 .019(, )J
f3_10 sf
@.223(sinh)A
f0_12 sf
@.203 .02(, )J
205 131 :M
f3_10 sf
@.201(tanh)A
f0_12 sf
@.168 .017(, )J
f3_10 sf
@.201(asin)A
f0_12 sf
@.183 .018(, )J
268 131 :M
f3_10 sf
@.289(atan)A
f0_12 sf
@.241 .024(, )J
f3_10 sf
@.289(asinh)A
f0_12 sf
@.488 .049(, and )J
f3_10 sf
@.289(atanh)A
f0_12 sf
@.75 .075( are imaginary;  and the)J
78 143 :M
-.009(types of the others are complex.)A
96 167 :M
@.41 .041(Given an imaginary argument, each of the type-generic macros )J
409 167 :M
f3_10 sf
(cos)S
f0_12 sf
(, )S
f3_10 sf
(sin)S
f0_12 sf
(, )S
458 167 :M
f3_10 sf
(tan)S
f0_12 sf
(, )S
483 167 :M
f3_10 sf
(cosh)S
f0_12 sf
(,)S
48 167 :M
(1)S
54 167 :M
(0)S
78 179 :M
f3_10 sf
@.201(sinh)A
f0_12 sf
@.183 .018(, )J
110 179 :M
f3_10 sf
@.201(tanh)A
f0_12 sf
@.183 .018(, )J
142 179 :M
f3_10 sf
@.201(asin)A
f0_12 sf
@.183 .018(, )J
174 179 :M
f3_10 sf
@.201(atan)A
f0_12 sf
@.183 .018(, )J
206 179 :M
f3_10 sf
@.392(asinh)A
f0_12 sf
@.688 .069(, and )J
265 179 :M
f3_10 sf
@.433(atanh)A
f0_12 sf
1.081 .108( is specified by a formula in terms of real)J
78 191 :M
-.11(functions:)A
96 215 :M
-.045(cos\(i*y\))A
150 215 :M
(=)S
186 215 :M
-.163(cosh\(y\))A
96 227 :M
-.046(sin\(i*y\))A
150 227 :M
(=)S
186 227 :M
-.04(i*sinh\(y\))A
48 227 :M
(1)S
54 227 :M
(5)S
96 239 :M
-.14(tan\(i*y\))A
150 239 :M
(=)S
186 239 :M
-.123(i*tanh\(y\))A
96 251 :M
-.039(cosh\(i*y\))A
150 251 :M
(=)S
186 251 :M
-.196(cos\(y\))A
96 263 :M
-.04(sinh\(i*y\))A
150 263 :M
(=)S
186 263 :M
-.046(i*sin\(y\))A
96 275 :M
-.123(tanh\(i*y\))A
150 275 :M
(=)S
186 275 :M
-.14(i*tan\(y\))A
96 287 :M
-.081(asin\(i*y\))A
150 287 :M
(=)S
186 287 :M
-.072(i*asinh\(y\))A
48 287 :M
(2)S
54 287 :M
(0)S
96 299 :M
-.038(atan\(i*y\))A
150 299 :M
(=)S
186 299 :M
-.034(i*atanh\(y\))A
96 311 :M
-.072(asinh\(i*y\))A
150 311 :M
(=)S
186 311 :M
-.081(i*asin\(y\))A
96 323 :M
-.034(atanh\(i*y\))A
150 323 :M
(=)S
186 323 :M
-.038(i*atan\(y\))A
48 347 :M
(2)S
54 347 :M
(5)S
endp
%%Trailer
end		% md
%%EOF
@EOF

chmod 640 type_generic_math.ps

exit 0
