Changeset 43f8fd8


Ignore:
Timestamp:
Aug 8, 2017, 5:34:06 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
5ea26ed
Parents:
c92c09c
Message:

div is not remquo, rewrite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/math

    rc92c09c r43f8fd8  
    1010// Created On       : Mon Apr 18 23:37:04 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jul 31 09:21:48 2017
    13 // Update Count     : 102
     12// Last Modified On : Mon Aug  7 07:51:15 2017
     13// Update Count     : 108
    1414//
    1515
     
    3939static inline [ int, long double ] remquo( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; }
    4040
    41 // alternative name for remquo
    42 static inline float div( float x, float y, int * quo ) { return remquof( x, y, quo ); }
    43 static inline double div( double x, double y, int * quo ) { return remquo( x, y, quo ); }
    44 static inline long double div( long double x, long double y, int * quo ) { return remquol( x, y, quo ); }
    45 static inline [ int, float ] div( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; }
    46 static inline [ int, double ] div( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; }
    47 static inline [ int, long double ] div( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; }
     41static inline [ float, float ] div( float x, float y ) { y = modff( x / y, &x ); return [ x, y ]; }
     42static inline [ double, double ] div( double x, double y ) { y = modf( x / y, &x ); return [ x, y ]; }
     43static inline [ long double, long double ] div( long double x, long double y ) { y = modfl( x / y, &x ); return [ x, y ]; }
    4844
    4945static inline float fma( float x, float y, float z ) { return fmaf( x, y, z ); }
Note: See TracChangeset for help on using the changeset viewer.