<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">long double math.h functions appear to not be exported in swift. I don’t know why.<br class=""><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">This horrible hack works:</div><div class=""><br class=""></div><div class=""><div class="">// in f80.h</div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extern</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> sqrt_f80( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *result, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *v );</span></div></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extern</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> pow_f80( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *result, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *v, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *e );</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;">...</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><br class=""></span></div></span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><div class="">// in f80.c</div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> sqrt_f80( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *result, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *v )<span class="Apple-tab-span" style="white-space: pre;">        </span>{ *(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">long</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">double</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *)result = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">sqrtl</span><span class="" style="font-variant-ligatures: no-common-ligatures;">( *(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">long</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">double</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *)v ); }</span></div></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> pow_f80( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *result, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *v, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">void</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *e )<span class="Apple-tab-span" style="white-space: pre;">        </span>{ *(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">long</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">double</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *)result = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">powl</span><span class="" style="font-variant-ligatures: no-common-ligatures;">( *(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">long</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">double</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *)v,*(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">const</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">long</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">double</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *)e ); }</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;">…</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><br class=""></span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;">// in f80.swift</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> sqrt( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> a:</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float80</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float80</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;">                </span>{ </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> result = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float80</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(); </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> v = a; </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">sqrt_f80</span><span class="" style="font-variant-ligatures: no-common-ligatures;">( &result, &v ); </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">return</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> result; }</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="font-family: Menlo; font-size: 11px; margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> pow( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> a:</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float80</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> e:</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float80</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float80</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> result = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float80</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(); </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> v1 = a; </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> v2 = e; </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">pow_f80</span><span class="" style="font-variant-ligatures: no-common-ligatures;">( &result, &v1, &v2 ); </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">return</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> result; }</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;">…</span></div></div></span></div></span></div></span></div></span></div></div><div class=""><br class=""></div><div class="">Sorry for my bad english.</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">Il giorno 05 lug 2016, alle ore 19:44, Jeff Kelley via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> ha scritto:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hello all,</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>I’m using Xcode 8.0 and Swift 3 on OS X 10.11, and I’m trying to use <font face="Menlo" class="">powl</font> in an OS X Playground. I see the definition of the <font face="Menlo" class="">pow</font>-related functions in <font face="Menlo" class="">math.h</font> here:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo; color: rgb(195, 34, 117);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">extern</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">float</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> powf(</span><span style="font-variant-ligatures: no-common-ligatures" class="">float</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, </span><span style="font-variant-ligatures: no-common-ligatures" class="">float</span><span style="font-variant-ligatures: no-common-ligatures;" class="">);</span></div><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo; color: rgb(195, 34, 117);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">extern</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">double</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> pow(</span><span style="font-variant-ligatures: no-common-ligatures" class="">double</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, </span><span style="font-variant-ligatures: no-common-ligatures" class="">double</span><span style="font-variant-ligatures: no-common-ligatures;" class="">);</span></div><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo; color: rgb(195, 34, 117);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">extern</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">long</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">double</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> powl(</span><span style="font-variant-ligatures: no-common-ligatures" class="">long</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">double</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, </span><span style="font-variant-ligatures: no-common-ligatures" class="">long</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">double</span><span style="font-variant-ligatures: no-common-ligatures;" class="">);</span></div></div><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo; color: rgb(195, 34, 117);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class="">But the Swift-imported version at <font face="Menlo" class="">Darwin.C.math</font> looks like this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> powf(</span><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Float</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Float</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Float</span></div><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> pow(</span><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">_</span><span style="font-variant-ligatures: no-common-ligatures;" class="">: </span><span style="font-variant-ligatures: no-common-ligatures" class="">Double</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">_</span><span style="font-variant-ligatures: no-common-ligatures;" class="">: </span><span style="font-variant-ligatures: no-common-ligatures" class="">Double</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures" class="">Double</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">Where did <font face="Menlo" class="">powl</font> go?</div><div class=""><br class=""></div><br class=""><div class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Jeff Kelley</div><div class=""><br class=""></div><div class=""><a href="mailto:SlaunchaMan@gmail.com" class="">SlaunchaMan@gmail.com</a> | <a href="https://twitter.com/SlaunchaMan" class="">@SlaunchaMan</a> | <a href="http://jeffkelley.org/" class="">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>
<br class=""></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></div><br class=""></body></html>