comparison src/c/urweb.c @ 1571:f403e129c276

Primitive int/float functions: ceil, float, round, trunc
author Adam Chlipala <adam@chlipala.net>
date Sat, 08 Oct 2011 17:23:58 -0400
parents e1f5d9c4cc20
children 43f22a8f76cc
comparison
equal deleted inserted replaced
1570:c7d0328ba777 1571:f403e129c276
14 #include <sys/types.h> 14 #include <sys/types.h>
15 #include <sys/socket.h> 15 #include <sys/socket.h>
16 #include <openssl/des.h> 16 #include <openssl/des.h>
17 #include <openssl/rand.h> 17 #include <openssl/rand.h>
18 #include <time.h> 18 #include <time.h>
19 #include <math.h>
19 20
20 #include <pthread.h> 21 #include <pthread.h>
21 22
22 #include "types.h" 23 #include "types.h"
23 24
3954 } 3955 }
3955 3956
3956 uw_Basis_string uw_Basis_fresh(uw_context ctx) { 3957 uw_Basis_string uw_Basis_fresh(uw_context ctx) {
3957 return uw_Basis_htmlifyInt(ctx, ctx->nextId++); 3958 return uw_Basis_htmlifyInt(ctx, ctx->nextId++);
3958 } 3959 }
3960
3961 uw_Basis_float uw_Basis_floatFromInt(uw_context ctx, uw_Basis_int n) {
3962 return n;
3963 }
3964
3965 uw_Basis_int uw_Basis_ceil(uw_context ctx, uw_Basis_float n) {
3966 return ceil(n);
3967 }
3968
3969 uw_Basis_int uw_Basis_trunc(uw_context ctx, uw_Basis_float n) {
3970 return trunc(n);
3971 }
3972
3973 uw_Basis_int uw_Basis_round(uw_context ctx, uw_Basis_float n) {
3974 return round(n);
3975 }