Changeset 5ea26ed for src/libcfa


Ignore:
Timestamp:
Aug 8, 2017, 5:36:27 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
08d14cf
Parents:
43f8fd8
Message:

add monomorphic div for basic types

Location:
src/libcfa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib

    r43f8fd8 r5ea26ed  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 20 14:32:37 2017
    13 // Update Count     : 220
     12// Last Modified On : Mon Aug  7 11:19:07 2017
     13// Update Count     : 223
    1414//
    1515
     
    183183//---------------------------------------
    184184
     185[ int, int ] div( int num, int denom );
     186[ long int, long int ] div( long int num, long int denom );
     187[ long long int, long long int ] div( long long int num, long long int denom );
    185188forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
    186 [ T, T ] div( T t1, T t2 );
     189[ T, T ] div( T num, T demon );
    187190
    188191//---------------------------------------
  • src/libcfa/stdlib.c

    r43f8fd8 r5ea26ed  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 20 16:01:40 2017
    13 // Update Count     : 282
     12// Last Modified On : Tue Aug  8 17:31:13 2017
     13// Update Count     : 291
    1414//
    1515
     
    255255//---------------------------------------
    256256
     257[ int, int ] div( int num, int denom ) { div_t qr = div( num, denom ); return [ qr.quot, qr.rem ]; }
     258[ long int, long int ] div( long int num, long int denom ) { ldiv_t qr = ldiv( num, denom ); return [ qr.quot, qr.rem ]; }
     259[ long long int, long long int ] div( long long int num, long long int denom ) { lldiv_t qr = lldiv( num, denom ); return [ qr.quot, qr.rem ]; }
    257260forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
    258 [ T, T ] div( T t1, T t2 ) { return [ t1 / t2, t1 % t2 ]; }
     261[ T, T ] div( T num, T denom ) { return [ num / denom, num % denom ]; }
    259262
    260263//---------------------------------------
Note: See TracChangeset for help on using the changeset viewer.