{"id":418,"date":"2011-12-06T21:36:32","date_gmt":"2011-12-06T20:36:32","guid":{"rendered":"http:\/\/www.thelins.se\/johan\/blog\/?p=418"},"modified":"2011-12-06T21:37:40","modified_gmt":"2011-12-06T20:37:40","slug":"qbound-on-arm","status":"publish","type":"post","link":"https:\/\/www.thelins.se\/johan\/blog\/2011\/12\/qbound-on-arm\/","title":{"rendered":"qBound on Arm"},"content":{"rendered":"<p>When using <a href=\"http:\/\/doc.qt.nokia.com\/latest\/qtglobal.html#qBound\">qBound<\/a> in combination with <a href=\"http:\/\/doc.qt.nokia.com\/latest\/qtglobal.html#qreal-typedef\">qreal<\/a>, it is important to properly cast the upper and lower bounds, e.g.:<\/p>\n<p><code>qreal x = qBound(qreal(0.2), v, qreal(1.5));<\/code><\/p>\n<p>If you forget this, i.e by using the following code:<\/p>\n<p><code>qreal x = qBound(0.2, v, 1.5);<\/code><\/p>\n<p>Your code will happily work on x86, and some other platforms, but not on Arm. This is because qreal is a double on all other platforms than Arm. On Arm, it is a float. This leads to GCC complaining about not being able to instantiate the template.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using qBound in combination with qreal, it is important to properly cast the upper and lower bounds, e.g.: qreal x = qBound(qreal(0.2), v, qreal(1.5)); If you forget this, i.e by using the following code: qreal x = qBound(0.2, v, 1.5); Your code will happily work on x86, and some other platforms, but not on &hellip; <a href=\"https:\/\/www.thelins.se\/johan\/blog\/2011\/12\/qbound-on-arm\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">qBound on Arm<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4],"tags":[],"class_list":["post-418","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-qt"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/comments?post=418"}],"version-history":[{"count":4,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/418\/revisions"}],"predecessor-version":[{"id":423,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/418\/revisions\/423"}],"wp:attachment":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/media?parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/categories?post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/tags?post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}