Showing content from https://www.open-std.org/jtc1/sc22/wg14/www/docs/n639.ps below:
%!PS-Adobe-3.0 %%Title: (Microsoft Word - type-generic\311) %%Creator: (Microsoft Word: PSPrinter 8.1.1) %%CreationDate: (9:00 AM Friday, January 3, 1997) %%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 172 80 :M f1_12 sf -.006(WG14/N639 X3J11/97-002 \(Draft 1997-01-03\))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( )A f0_12 sf .093 .009( and )J 367 241 :M f3_10 sf .059( )A f0_12 sf .166 .017(. The proposed)J 78 253 :M (header )S 114 253 :M f3_10 sf .115( )A f0_12 sf .32 .032( includes the headers )J f3_10 sf .115( )A f0_12 sf .179 .018( and )J f3_10 sf .115( )A f0_12 sf .364 .036( and extends them)J 78 265 :M -.007(by defining the type-generic macros.)A 78 289 :M f1_12 sf -.038(Background)A 48 289 :M f0_12 sf (2)S 54 289 :M (0)S 96 313 :M -.05(As rece)A 133 313 :M -.007(nt as December 1995, the floating-point and complex arithmetic specifications)A 78 325 :M .204 .02(included type-generic macros, under the name of overloading macros. Then, in response)J 78 337 :M 1.51 .151(to the wishes of the C committees, these specifications were redrafted removing the)J 78 349 :M -.009(overloading macros, with the intention of later considering them as a separate feature.)A 48 349 :M (2)S 54 349 :M (5)S 96 373 :M .786 .079(At the Amsterdam meeting, the committees accepted in principle the floating-point)J 78 385 :M .82 .082(and 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 2.079 .208(than overloading. Such a proposal \(N618\) was presented as a Monday paper and)J 48 409 :M (3)S 54 409 :M (0)S 78 421 :M -.014(discussed in detail at the Toronto meeting.)A 96 445 :M .43 .043(This document incorporates the input from Toronto, and is intended as a proposal to)J 78 457 :M -.005(be voted on \(for inclusion into C9X\) at the Kona meeting.)A 48 469 :M (3)S 54 469 :M (5)S 78 481 :M f1_12 sf -.047(Proposal)A 96 505 :M f0_12 sf 2.426 .243(Rationale given here supplements the rationale in the earlier specification for)J 78 517 :M -.007(overloading, and is not intended as a complete rationale for the feature.)A 48 529 :M (4)S 54 529 :M (0)S 78 553 :M f2_12 sf -.036(In 7, insert this subclause:)A 78 588 :M f1_18 sf -.014(7.x Type-generic math )A 48 606 :M f0_12 sf (4)S 54 606 :M (5)S 96 619 :M 2.457 .246(The header )J 161 619 :M f3_10 sf .578( )A f0_12 sf 1.631 .163( includes the headers )J 341 619 :M f3_10 sf .433( )A f0_12 sf .673 .067( and )J f3_10 sf .433( )A f0_12 sf 1.128 .113( and)J 78 631 :M -.041(defines several )A 153 631 :M f2_12 sf -.014(type-generic macros)A f0_12 sf (.)S 114 655 :M f0_10 sf .433 .043([The term )J f2_10 sf .14(type-generic)A 210 655 :M f0_10 sf 1.16 .116( was chosen as more specific than the suggested term )J f2_10 sf .305(intrinsic)A f0_10 sf (,)S 114 666 :M 1.588 .159(which already is widely used with a more general meaning. The X3J11 Vocabulary)J 48 666 :M f0_12 sf (5)S 54 666 :M (0)S 114 677 :M f0_10 sf -.008(Representative concurs with this choice.)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 -.031(WG14/N639 X3J11/97-002)A 418 14 :M -.11(1997-01-03)A 42 722 :M (2)S 379 722 :M -.059(Type-Generic Math)A 78 61 :M f0_10 sf .39 .039(The macros are placed in their own header in order not to silently break old programs that)J 78 72 :M -.133(include )A 110 72 :M f3_9 sf -.267( )A f0_10 sf -.194(, for example with )A f3_9 sf -.267(printf\("%e", sin\(x\)\);)A f0_10 sf -.247( .)A 78 94 :M .462 .046(The name )J f3_9 sf .171(tgmath.h)A f0_10 sf .404 .04( is shorter than the previous )J 284 94 :M f3_9 sf -.047(generic_math.h)A f0_10 sf -.039(, which the committee)A 18 94 :M f0_12 sf (5)S 78 105 :M f0_10 sf -.047(thought was too long.])A 42 134 :M f1_14 sf -.022(7.x.1 Type-generic macros)A 60 161 :M f0_12 sf 2.992 .299(Of the )J f3_10 sf 1.454( )A f0_12 sf 2.356 .236( and )J 189 161 :M f3_10 sf .892( )A f0_12 sf 2.55 .255( functions without an )J 386 161 :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 161 :M f3_10 sf (l)S 12 161 :M f0_12 sf (1)S 18 161 :M (0)S 42 173 :M (\()S 46 173 :M f3_10 sf .272(long\312double)A f0_12 sf .92 .092(\) suffix, several have one or more parameters whose corresponding real)J 42 185 :M .866 .087(type is )J 80 185 :M f3_10 sf .251(double)A f0_12 sf .694 .069( and return a result whose corresponding real type is )J 383 185 :M f3_10 sf .233(double)A f0_12 sf .492 .049(. For each)J 42 197 :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 197 :M f2_12 sf -.087(type-generic)A 42 211 :M -.164(macro)A 73 208 :M f0_9 sf (1)S 77 211 :M f0_12 sf 2.127 .213(. The parameters whose corresponding real type is )J 355 211 :M f3_10 sf .552(double)A f0_12 sf 1.492 .149( in the function)J 42 223 :M 2.819 .282(synopsis are )J 114 223 :M f2_12 sf 1.618 .162(generic parameters)J 213 223 :M f0_12 sf 3.264 .326(. Use of the macro invokes a function whose)J 12 223 :M (1)S 18 223 :M (5)S 42 235 :M .074 .007(corresponding real type and type-domain are determined by the arguments for the generic)J 42 247 :M -.063(parameters.)A 78 271 :M f0_10 sf -.22([)A f3_9 sf -.374(modf\(double, double*\))A 188 271 :M f0_10 sf .726 .073( is excluded because no way was seen to make it safe without)J 78 282 :M -.029(complicating the type resolution.])A 12 282 :M f0_12 sf (2)S 18 282 :M (0)S 60 305 :M .022 .002(Use of the macro invokes a function whose corresponding real type is the wider of the)J 42 317 :M .224 .022(corresponding real types of floating arguments for generic parameters, with integral-type)J 42 329 :M -.009(arguments for generic parameters first being converted to )A 321 329 :M f3_10 sf (double)S f0_12 sf (.)S 12 341 :M (2)S 18 341 :M (5)S 78 353 :M f0_10 sf .42 .042([This differs from the earlier overloading proposal in that the type is determined solely by)J 78 364 :M .577 .058(the argument, and may be narrower than the type for expression evaluation. This change)J 78 375 :M -.008(was made because the performance costs for computing functions with narrow arguments to)A 78 386 :M 1.91 .191(wide range and precision might be too high, even if the implementation efficiently)J 78 397 :M -.006(evaluates basic operations to wide precision.)A 12 397 :M f0_12 sf (3)S 18 397 :M (0)S 78 419 :M f0_10 sf .855 .086(Also, this differs from earlier proposals in that integral-type arguments are converted to)J 78 430 :M f3_9 sf -.048(double)A f0_10 sf -.033( instead of )A f3_9 sf -.048(float)A f0_10 sf -.037(. Although converting to )A 284 430 :M f3_9 sf (float)S f0_10 sf .023 .002( would have been more consistent)J 78 441 :M 2.055 .205(with the usual arithmetic conversions, converting to )J 314 441 :M f3_9 sf .551(double)A f0_10 sf 1.477 .148( has the advantages of)J 78 452 :M .269 .027(preserving the value more often on many systems, and of being more compatible with C90)J 12 452 :M f0_12 sf (3)S 18 452 :M (5)S 78 463 :M f0_10 sf 1.259 .126(where unsuffixed calls to math functions with integer arguments were calls to )J 417 463 :M f3_9 sf -.478(double)A 78 474 :M f0_10 sf (functions.])S 60 497 :M f0_12 sf 3.185 .319(For each unsuffixed function in )J f3_10 sf 1.016( )A f0_12 sf 2.505 .251( for which there is a function in)J 42 509 :M f3_10 sf .155( )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 12 509 :M (4)S 18 509 :M (0)S 42 521 :M 2.015 .201(macro \(for both functions\) has the same name as the function in )J f3_10 sf .719( )A f0_12 sf 1.326 .133(. The)J 42 533 :M -.016(corresponding type-generic macro for )A 227 533 :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 42 662 :M ( )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 -.02(Draft 1997-01-03)A 376 14 :M -.031(WG14/N639 X3J11/97-002)A 78 722 :M -.059(Type-Generic Math)A 504 722 :M (3)S 114 50 :M f3_10 sf ( )S 222 50 :M ( )S 330 50 :M f0_12 sf -.087(type-generic)A 114 62 :M -.141(function)A 222 62 :M -.141(function)A 330 62 :M -.245(macro)A 114 74 :M -.103(----------)A 222 74 :M -.076(-------------)A 330 74 :M -.064(---------------)A 114 86 :M f3_10 sf (acos)S 222 86 :M (cacos)S 330 86 :M (acos)S 114 97 :M (asin)S 222 97 :M (casin)S 330 97 :M (asin)S 54 97 :M f0_12 sf (5)S 114 108 :M f3_10 sf (atan)S 222 108 :M (catan)S 330 108 :M (atan)S 114 119 :M (acosh)S 222 119 :M (cacosh)S 330 119 :M (acosh)S 114 130 :M (asinh)S 222 130 :M (casinh)S 330 130 :M (asinh)S 114 141 :M (atanh)S 222 141 :M (catanh)S 330 141 :M (atanh)S 114 152 :M (cos)S 222 152 :M (ccos)S 330 152 :M (cos)S 48 152 :M f0_12 sf (1)S 54 152 :M (0)S 114 163 :M f3_10 sf (sin)S 222 163 :M (csin)S 330 163 :M (sin)S 114 174 :M (tan)S 222 174 :M (ctan)S 330 174 :M (tan)S 114 185 :M (cosh)S 222 185 :M (ccosh)S 330 185 :M (cosh)S 114 196 :M (sinh)S 222 196 :M (csinh)S 330 196 :M (sinh)S 114 207 :M (tanh)S 222 207 :M (ctanh)S 330 207 :M (tanh)S 48 207 :M f0_12 sf (1)S 54 207 :M (5)S 114 218 :M f3_10 sf (exp)S 222 218 :M (cexp)S 330 218 :M (exp)S 114 229 :M (log)S 222 229 :M (clog)S 330 229 :M (log)S 114 240 :M (pow)S 222 240 :M (cpow)S 330 240 :M (pow)S 114 251 :M (sqrt)S 222 251 :M (csqrt)S 330 251 :M (sqrt)S 114 262 :M (fabs)S 222 262 :M (cabs)S 330 262 :M (fabs)S 48 262 :M f0_12 sf (2)S 54 262 :M (0)S 78 285 :M 1.712 .171(If at least one argument for a generic parameter is complex, then use of the macro)J 78 297 :M -.002(invokes a complex function; otherwise, use of the macro invokes a real function.)A 114 321 :M f0_10 sf -.007([Having a )A f3_10 sf (g)S f0_10 sf -.007( suffix for the generic macros was considered but thought unnecessary.])A 48 321 :M f0_12 sf (2)S 54 321 :M (5)S 114 344 :M 1.077 .108(For each unsuffixed function in )J 278 344 :M f3_10 sf .218( )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 356 :M f3_10 sf .111( )A f0_12 sf .364 .036(, the corresponding type-generic macro has the same name as the function.)J 78 368 :M -.032(These type-generic macros are)A 48 380 :M (3)S 54 380 :M (0)S 78 392 :M ( )S 114 392 :M f3_10 sf (atan2)S 114 403 :M (exp2)S 114 414 :M (expm1)S 114 425 :M (frexp)S 114 436 :M (ldexp)S 57 436 :M f0_12 sf (3)S 63 436 :M (5)S 114 447 :M f3_10 sf (log10)S 114 458 :M (log1p)S 114 469 :M (log2)S 114 480 :M (logb)S 114 491 :M (scalb)S 57 491 :M f0_12 sf (4)S 63 491 :M (0)S 270 392 :M f3_10 sf (hypot)S 270 403 :M (erf)S 270 414 :M (erfc)S 270 425 :M (gamma)S 270 436 :M (lgamma)S 213 436 :M f0_12 sf (4)S 219 436 :M (5)S 270 447 :M f3_10 sf (ceil)S 270 458 :M (floor)S 270 469 :M (fmod)S 270 480 :M (nearbyint)S 270 491 :M (rint)S 213 491 :M f0_12 sf (5)S 219 491 :M (0)S 426 392 :M f3_10 sf (round)S 426 403 :M (trunc)S 426 414 :M (remainder)S 426 425 :M (remquo)S 426 436 :M (copysign)S 369 436 :M f0_12 sf (5)S 375 436 :M (5)S 426 447 :M f3_10 sf (nextafter)S 426 458 :M (fdim)S 426 469 :M (fmax)S 426 480 :M (fmin)S 48 502 :M f0_12 sf (6)S 54 502 :M (0)S 78 514 :M 1.173 .117(If all arguments for generic parameters are real, then use of the macro invokes a real)J 78 526 :M -.003(function; otherwise, use of the macro results in undefined behavior.)A 114 550 :M f0_10 sf .287 .029([The implementation might, as an extension, endow appropriate ones of these macros with)J 114 561 :M -.005(the ability to invoke the complex functions whose names are reserved in 7.14.4.])A 48 561 :M f0_12 sf (6)S 54 561 :M (5)S 96 584 :M .339 .034(For each unsuffixed function in )J f3_10 sf .108( )A f0_12 sf .174 .017( that is not a )J 385 584 :M f3_10 sf .052(c)A f0_12 sf .233 .023(-prefixed counter-part to)J 78 596 :M .314 .031(a function in )J 144 596 :M f3_10 sf .097( )A f0_12 sf .312 .031(, the corresponding type-generic macro has the same name as the)J 78 608 :M -.023(function. These type-generic macros are)A 48 620 :M (7)S 54 620 :M (0)S 114 632 :M f3_10 sf (carg)S 114 643 :M (conj)S 270 632 :M (cimag)S 270 643 :M (cproj)S 426 632 :M (creal)S 369 632 :M f0_12 sf (7)S 375 632 :M (5)S 78 666 :M -.014(Use of the macro with any real or complex arguments invokes a )A 388 666 :M f3_10 sf -.052( )A f0_12 sf -.044( function.)A endp %%Page: 4 4 %%BeginPageSetup initializepage (; page: 4 of 5)setjob %%EndPageSetup gS 0 0 552 730 rC 42 14 :M f0_12 sf -.031(WG14/N639 X3J11/97-002)A 418 14 :M -.11(1997-01-03)A 42 722 :M (4)S 379 722 :M -.059(Type-Generic Math)A 42 50 :M f1_12 sf -.142(Examples)A 60 74 :M f0_12 sf -.031(With the declarations)A 78 98 :M f3_10 sf (#include )S 18 98 :M f0_12 sf (5)S 78 109 :M f3_10 sf (int n;)S 78 120 :M (float f;)S 78 131 :M (double d;)S 78 142 :M (long double ld;)S 78 153 :M (float complex fc;)S 12 153 :M f0_12 sf (1)S 18 153 :M (0)S 78 164 :M f3_10 sf (double complex dc;)S 78 175 :M (long double complex ldc;)S 42 198 :M f0_12 sf -.008(functions invoked by use of type-generic macros are shown in the table:)A 12 210 :M (1)S 18 210 :M (5)S 60 222 :M -.122(macro use)A 186 222 :M -.054(invokes)A 60 234 :M -.064(---------------)A 186 234 :M -.083(------------)A 60 246 :M f3_10 sf (exp\(n\))S 186 246 :M -.038(exp\(n\))A f0_12 sf -.031(, the function)A 60 258 :M f3_10 sf (acosh\(f\))S 186 258 :M (acoshf\(f\))S 60 269 :M (sin\(d\))S 186 269 :M -.038(sin\(d\))A f0_12 sf -.031(, the function)A 12 269 :M (2)S 18 269 :M (0)S 60 281 :M f3_10 sf (atan\(ld\))S 186 281 :M (atanl\(ld\))S 60 292 :M (log\(fc\))S 186 292 :M (clogf\(fc\))S 60 303 :M (sqrt\(dc\))S 186 303 :M (csqrt\(dc\))S 60 314 :M (pow\(ldc, f\))S 186 314 :M (cpowl\(ldc, f\))S 60 325 :M (remainder\(n, n\))S 186 325 :M -.024(remainder\(n, n\))A f0_12 sf -.02(, the function)A 12 325 :M (2)S 18 325 :M (5)S 60 337 :M f3_10 sf (nextafter\(d, f\))S 186 337 :M -.024(nextafter\(d, f\))A f0_12 sf -.02(, the function)A 60 349 :M f3_10 sf (copysign\(n, ld\))S 186 349 :M (copysignl\(n, ld\))S 60 360 :M (ceil\(fc\))S 186 360 :M f0_12 sf -.056(undefined behavior)A 60 372 :M f3_10 sf (rint\(dc\))S 186 372 :M f0_12 sf -.056(undefined behavior)A 60 384 :M f3_10 sf (fmax\(ldc, ld\))S 186 384 :M f0_12 sf -.056(undefined behavior)A 12 384 :M (3)S 18 384 :M (0)S 60 396 :M f3_10 sf (carg\(n\))S 186 396 :M -.036(carg\(n\))A f0_12 sf -.029(, the function)A 60 408 :M f3_10 sf (cproj\(f\))S 186 408 :M (cprojf\(f\))S 60 419 :M (creal\(d\))S 186 419 :M -.034(creal\(d\))A f0_12 sf -.028(, the function)A 60 431 :M f3_10 sf (cimag\(ld\))S 186 431 :M (cimagl\(ld\))S 60 442 :M (cabs\(fc\))S 186 442 :M (cabsf\(fc\))S 12 442 :M f0_12 sf (3)S 18 442 :M (5)S 60 453 :M f3_10 sf (carg\(dc\))S 186 453 :M -.034(carg\(dc\))A f0_12 sf -.028(, the function)A 60 465 :M f3_10 sf (cproj\(ldc\))S 186 465 :M (cprojl\(ldc\))S 42 500 :M f2_12 sf -.01(Replace the subclause of 7 specifying the nextafter functions with \(leaving footnote 14 as)A 12 500 :M f0_12 sf (4)S 18 500 :M (0)S 42 512 :M f2_12 sf -.329(is\):)A 78 536 :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 559 :M f1_12 sf -.009(7.x.11.3 The )A f3_10 sf -.011(nextafter)A f1_12 sf -.01( functions)A 12 559 :M f0_12 sf (4)S 18 559 :M (5)S 42 583 :M f1_12 sf -.097(Synopsis)A 78 607 :M f3_10 sf (#include )S 78 618 :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 12 618 :M f0_12 sf (5)S 18 618 :M (0)S 78 629 :M f3_10 sf (float nextafterf\(float x, float y\);)S 78 640 :M (double nextafterd\(double x, double y\);)S 78 651 :M (long double nextafterl\(long double x, long double y\);)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 -.02(Draft 1997-01-03)A 376 14 :M -.031(WG14/N639 X3J11/97-002)A 78 722 :M -.059(Type-Generic Math)A 504 722 :M (5)S 78 50 :M f1_12 sf -.031(Description)A 96 74 :M f0_12 sf .264 .026(The )J 119 74 :M f3_10 sf .22(nextafter)A f0_12 sf .665 .067( function determines the next representable value, in the type of the)J 78 86 :M (function, after )S 150 86 :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 78 98 :M -.123(function.)A 121 94 :M f0_5 sf -.05(14)A f0_12 sf 0 4 rm -.111( The )A 0 -4 rm 154 98 :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 54 98 :M (5)S 96 122 :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 78 134 :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 477 134 :M f3_10 sf (float)S f0_12 sf (,)S 78 146 :M f3_10 sf -.107(double)A f0_12 sf -.085(, or )A 133 146 :M f3_10 sf -.043(long\312double)A f0_12 sf -.034(, respectively.)A 48 158 :M (1)S 54 158 :M (0)S 78 170 :M f1_12 sf -.053(Returns)A 96 194 :M f0_12 sf .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 297 194 :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 78 206 :M -.009(the next representable value in the specified format after )A 352 206 :M f3_10 sf (x)S f0_12 sf -.03( in the direction of )A 450 206 :M f3_10 sf (y)S f0_12 sf (.)S 48 221 :M (1)S 54 221 :M (5)S 78 248 :M f2_12 sf -.003(In the Annex Y: IEC 559-Compatible Complex Arithmetic, append the subclause:)A 78 280 :M f1_18 sf -.266(Y.7 )A f3_14 sf -.349( )A 48 296 :M f0_12 sf (2)S 54 296 :M (0)S 96 308 :M 3.523 .352(Type-generic macros that accept complex arguments also accept imaginary)J 78 320 :M .2 .02(arguments. If an argument is imaginary, the macro expands to an expression whose type)J 78 332 :M .181 .018(is real, imaginary, or complex, as appropriate for the particular function: if the argument)J 78 344 :M .518 .052(is imaginary, then the types of )J 232 344 :M f3_10 sf (cos)S f0_12 sf (, )S 257 344 :M f3_10 sf (cosh)S f0_12 sf (, )S 288 344 :M f3_10 sf (fabs)S f0_12 sf (, )S 319 344 :M f3_10 sf (carg)S f0_12 sf (, )S 350 344 :M f3_10 sf .077(cimag)A f0_12 sf .213 .021(, and)J 403 344 :M f3_10 sf .388 .039( creal )J 447 344 :M f0_12 sf .554 .055(are real; the)J 78 356 :M .804 .08(types of )J f3_10 sf .338(sin)A f0_12 sf .308 .031(, )J 148 356 :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 356 :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 356 :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 48 356 :M (2)S 54 356 :M (5)S 78 368 :M -.009(types of the others are complex.)A 96 392 :M .41 .041(Given an imaginary argument, each of the type-generic macros )J 409 392 :M f3_10 sf (cos)S f0_12 sf (, )S f3_10 sf (sin)S f0_12 sf (, )S 458 392 :M f3_10 sf (tan)S f0_12 sf (, )S 483 392 :M f3_10 sf (cosh)S f0_12 sf (,)S 78 404 :M f3_10 sf .201(sinh)A f0_12 sf .183 .018(, )J 110 404 :M f3_10 sf .201(tanh)A f0_12 sf .183 .018(, )J 142 404 :M f3_10 sf .201(asin)A f0_12 sf .183 .018(, )J 174 404 :M f3_10 sf .201(atan)A f0_12 sf .183 .018(, )J 206 404 :M f3_10 sf .392(asinh)A f0_12 sf .688 .069(, and )J 265 404 :M f3_10 sf .433(atanh)A f0_12 sf 1.081 .108( is specified by a formula in terms of real)J 78 416 :M -.11(functions:)A 48 416 :M (3)S 54 416 :M (0)S 96 440 :M -.045(cos\(i*y\))A 150 440 :M (=)S 186 440 :M -.163(cosh\(y\))A 96 452 :M -.046(sin\(i*y\))A 150 452 :M (=)S 186 452 :M -.04(i*sinh\(y\))A 96 464 :M -.165(tan\(i*y)A 130 464 :M (\))S 150 464 :M (=)S 186 464 :M -.123(i*tanh\(y\))A 96 476 :M -.039(cosh\(i*y\))A 150 476 :M (=)S 186 476 :M -.196(cos\(y\))A 48 476 :M (3)S 54 476 :M (5)S 96 488 :M -.04(sinh\(i*y\))A 150 488 :M (=)S 186 488 :M -.046(i*sin\(y\))A 96 500 :M -.123(tanh\(i*y\))A 150 500 :M (=)S 186 500 :M -.14(i*tan\(y\))A 96 512 :M -.081(asin\(i*y\))A 150 512 :M (=)S 186 512 :M -.072(i*asinh\(y\))A 96 524 :M -.038(atan\(i*y\))A 150 524 :M (=)S 186 524 :M -.034(i*atanh\(y\))A 96 536 :M -.072(asinh\(i*y\))A 150 536 :M (=)S 186 536 :M -.081(i*asin\(y\))A 48 536 :M (4)S 54 536 :M (0)S 96 548 :M -.034(atanh\(i*y\))A 150 548 :M (=)S 186 548 :M -.038(i*atan\(y\))A endp %%Trailer end % md %%EOF
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4