source: libcfa/src/common.cfa @ 79e261b7

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 79e261b7 was 58b6d1b, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Fixed tests after headers change

  • Property mode set to 100644
File size: 1.1 KB
Line 
1//                               -*- Mode: C -*-
2//
3// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
4//
5// The contents of this file are covered under the licence agreement in the
6// file "LICENCE" distributed with Cforall.
7//
8// common.c --
9//
10// Author           : Peter A. Buhr
11// Created On       : Thu Jul 12 08:02:29 2018
12// Last Modified By : Peter A. Buhr
13// Last Modified On : Thu Jul 12 08:38:47 2018
14// Update Count     : 3
15//
16
17#include "common.hfa"
18#include <stdlib.h>                                     // div_t, *div
19
20//---------------------------------------
21
22[ int, int ] div( int num, int denom ) { div_t qr = div( num, denom ); return [ qr.quot, qr.rem ]; }
23[ long int, long int ] div( long int num, long int denom ) { ldiv_t qr = ldiv( num, denom ); return [ qr.quot, qr.rem ]; }
24[ 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 ]; }
25forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
26[ T, T ] div( T num, T denom ) { return [ num / denom, num % denom ]; }
27
28// Local Variables: //
29// mode: c //
30// tab-width: 4 //
31// End: //
Note: See TracBrowser for help on using the repository browser.