{"id":27248,"date":"2019-11-08T17:11:36","date_gmt":"2019-11-08T22:11:36","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=27248"},"modified":"2019-11-08T17:11:36","modified_gmt":"2019-11-08T22:11:36","slug":"swift-numerics","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/11\/08\/swift-numerics\/","title":{"rendered":"Swift Numerics"},"content":{"rendered":"<p><a href=\"https:\/\/swift.org\/blog\/numerics\/\">Steve Canon<\/a> (<a href=\"https:\/\/twitter.com\/stephentyrone\/status\/1192549065822810132\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/swift.org\/blog\/numerics\/\"><p>I&rsquo;m excited to announce a new open-source project for the Swift ecosystem, <a href=\"https:\/\/github.com\/apple\/swift-numerics\">Swift Numerics<\/a>!\nSwift Numerics will provide the building blocks of numerical computing in Swift, as a set of fine-grained modules bundled together into a single Swift package.\nMy hope is that we can quickly fill some important gaps in the Standard Library&rsquo;s existing APIs, and unlock new domains of programming to the Swift language.<\/p><p>I&rsquo;ve seeded the repository with two much-requested modules that are immediately useful for computational mathematics: <code>Real<\/code> (providing the functionality of <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0246-mathable.md\">SE-0246<\/a>) and <code>Complex<\/code> (providing complex numbers and arithmetic).<\/p>\n<p>[&#8230;]<\/p>\n<p>The C and C++ complex math libraries attempt to make fine-grained distinctions between different zeros and infinities and NaNs. This is occasionally useful, but it means that multiplication cannot use the obvious arithmetic expression.<\/p>\n<p>Swift does not attempt to make this distinction. Any complex number with zero real and imaginary parts is zero, and all complex numbers with a non-finite real or imaginary part are collapsed into a single &ldquo;point at infinity&rdquo;.<\/p><\/blockquote>\n<p>Looks good to me.<\/p>","protected":false},"excerpt":{"rendered":"<p>Steve Canon (tweet): I&rsquo;m excited to announce a new open-source project for the Swift ecosystem, Swift Numerics! Swift Numerics will provide the building blocks of numerical computing in Swift, as a set of fine-grained modules bundled together into a single Swift package. My hope is that we can quickly fill some important gaps in the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2019-11-08T22:11:38Z","apple_news_api_id":"9dc3c468-0228-42f6-939c-e0728e17eb53","apple_news_api_modified_at":"2019-11-08T22:11:49Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AncPEaAIoQvaTnOByjhfrUw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[669,46,259,74,138,71,901],"class_list":["post-27248","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-floating-point","tag-languagedesign","tag-math","tag-opensource","tag-optimization","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=27248"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27248\/revisions"}],"predecessor-version":[{"id":27249,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27248\/revisions\/27249"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=27248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=27248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=27248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}