Changeset a35b458 in mainline for uspace/lib/math/generic/log.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

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

    r3061bc1 ra35b458  
    5555        float32_t ret = 0;
    5656        float32_t num = 1;
    57        
     57
    5858        for (unsigned int i = 1; i <= TAYLOR_DEGREE_32; i++) {
    5959                num *= arg;
    60                
     60
    6161                if ((i % 2) == 0)
    6262                        ret += num / i;
     
    6464                        ret -= num / i;
    6565        }
    66        
     66
    6767        return ret;
    6868}
     
    8383        float64_t ret = 0;
    8484        float64_t num = 1;
    85        
     85
    8686        for (unsigned int i = 1; i <= TAYLOR_DEGREE_64; i++) {
    8787                num *= arg;
    88                
     88
    8989                if ((i % 2) == 0)
    9090                        ret += num / i;
     
    9292                        ret -= num / i;
    9393        }
    94        
     94
    9595        return ret;
    9696}
     
    107107        float32_u m;
    108108        int e;
    109        
     109
    110110        m.val = arg;
    111111        /*
     
    118118        e = m.data.parts.exp - (FLOAT32_BIAS - 1);
    119119        m.data.parts.exp = FLOAT32_BIAS - 1;
    120        
     120
    121121        /*
    122122         * arg = m * 2^e ; log(arg) = log(m) + log(2^e) =
     
    137137        float64_u m;
    138138        int e;
    139        
     139
    140140        m.val = arg;
    141        
     141
    142142        /*
    143143         * Factor arg into m * 2^e where m has exponent -1,
     
    149149        e = m.data.parts.exp - (FLOAT64_BIAS - 1);
    150150        m.data.parts.exp = FLOAT64_BIAS - 1;
    151        
     151
    152152        /*
    153153         * arg = m * 2^e ; log(arg) = log(m) + log(2^e) =
Note: See TracChangeset for help on using the changeset viewer.