<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">(1- (integer-length x))<div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 1, 2021, at 1:24 AM, Marco Antoniotti <<a href="mailto:marco.antoniotti@unimib.it" class="">marco.antoniotti@unimib.it</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">
<div class="">Hi</div><div class=""><br class=""></div><div class="">I am wasti.... devoting some time to recreational hacking and I bumped into an interesting bit fiddling operation.<br class=""><br class=""></div><div class="">I
pored over the CLHS, but, while I may have missed something obvious, I
am not sure what would be the best way to implement such a function
using the standard operations.<br class=""><br class=""></div><div class="">Any ideas?<br class=""><br class=""></div><div class="">Note that it appears that most HW does have an instruction to do that directly.</div><div class="">
<a href="https://en.wikipedia.org/wiki/Find_first_set" target="_blank" class="">Find first set - Wikipedia</a> <br class=""></div><div class=""><br class=""></div><div class="">Thanks</div>
Marco<br clear="all" class=""><div class=""><br class="">-- <br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; display: inline; float: none;" class="">Marco Antoniotti, Associate Professor</span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px; text-decoration: none;" class=""> </span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px; text-decoration: none;" class=""> </span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; display: inline; float: none;" class="">tel.</span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; word-spacing: 0px; text-decoration: none; display: inline; float: none; white-space: pre;" class=""> </span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; display: inline; float: none;" class="">+39 - 02 64 48 79 01</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; display: inline; float: none;" class="">DISCo, Università Milano Bicocca U14 2043</span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px; text-decoration: none;" class=""> </span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px; text-decoration: none;" class=""> </span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px; text-decoration: none;" class=""></span><a href="http://bimib.disco.unimib.it/" style="font-family:Helvetica;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">http://bimib.disco.unimib.it</a><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; display: inline; float: none;" class="">Viale Sarca 336</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; display: inline; float: none;" class="">I-20126 Milan (MI) ITALY</span><br class=""></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>