Issue 27 in libfixmath: Probably error in log2 functions test for skipping decimal part

4 views
Skip to first unread message

libfi...@googlecode.com

unread,
Dec 18, 2013, 9:07:05 PM12/18/13
to libfi...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 27 by raphen...@gmail.com: Probably error in log2 functions test
for skipping decimal part
http://code.google.com/p/libfixmath/issues/detail?id=27

line 132 in fix16_exp.c reads:
if(x == 0) return (result << 16);

but it probably should be
if(x == 1) return (result << 16);

If I understand correctly this is to test if x was dividable by 2. In other
words, do we need to calculate decimal part.

So if x was 2^n then x is 1 after the while loop as 2^0 is 1.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages