Changeset 83932dc9 in mainline for uspace/lib/math/generic/fmod.c


Ignore:
Timestamp:
2018-09-12T16:51:07Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b2aaaa0
Parents:
ec9aadd
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-12 16:50:02)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-12 16:51:07)
Message:

Split up libmath functions into more files

so that they don't conflict with fdlibm during static linking.

File:
1 edited

Legend:

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

    rec9aadd r83932dc9  
    3535#include <math.h>
    3636
    37 /** Remainder function (32-bit floating point)
    38  *
    39  * Calculate the modulo of dividend by divisor.
    40  *
    41  * This is a very basic implementation that uses
    42  * division and multiplication (instead of exact
    43  * arithmetics). Thus the result might be very
    44  * imprecise (depending on the magnitude of the
    45  * arguments).
    46  *
    47  * @param dividend Dividend.
    48  * @param divisor  Divisor.
    49  *
    50  * @return Modulo.
    51  *
    52  */
    53 float fmodf(float dividend, float divisor)
    54 {
    55         // FIXME: replace with exact arithmetics
    56 
    57         float quotient = truncf(dividend / divisor);
    58 
    59         return (dividend - quotient * divisor);
    60 }
    61 
    6237/** Remainder function (64-bit floating point)
    6338 *
Note: See TracChangeset for help on using the changeset viewer.