Changeset f23dbf4 in mainline


Ignore:
Timestamp:
2021-06-18T16:06:17Z (3 years ago)
Author:
Maurizio Lombardi <mlombard@…>
Children:
e1fc596c
Parents:
ca113cf
git-author:
Maurizio Lombardi <mlombard@…> (2018-11-25 16:57:56)
git-committer:
Maurizio Lombardi <mlombard@…> (2021-06-18 16:06:17)
Message:

math: fix comparisons of integers with different signedness

Location:
uspace/lib/math/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/math/generic/pow.c

    rca113cf rf23dbf4  
    136136                if(k>20) {
    137137                    j = ly>>(52-k);
    138                     if((j<<(52-k))==ly) yisint = 2-(j&1);
     138                    if((uint32_t)(j<<(52-k))==ly) yisint = 2-(j&1);
    139139                } else if(ly==0) {
    140140                    j = iy>>(20-k);
  • uspace/lib/math/generic/sqrt.c

    rca113cf rf23dbf4  
    158158            if((t<ix0)||((t==ix0)&&(t1<=ix1))) {
    159159                s1  = t1+r;
    160                 if(((t1&sign)==sign)&&(s1&sign)==0) s0 += 1;
     160                if(((int32_t)(t1&sign)==sign)&&(s1&sign)==0) s0 += 1;
    161161                ix0 -= t;
    162162                if (ix1 < t1) ix0 -= 1;
Note: See TracChangeset for help on using the changeset viewer.