ack/lang/basic/lib/mki.c

31 lines
402 B
C
Raw Normal View History

#include "bc_string.h"
1984-11-29 14:22:02 +00:00
1994-06-24 11:31:16 +00:00
/* $Id$ */
1984-11-29 14:22:02 +00:00
String* _mki(long i)
1984-11-29 14:22:02 +00:00
{
char* buffer = " ";
String* s;
1984-11-29 14:22:02 +00:00
s = _newstr(buffer);
*((long*)s->strval) = i;
return (s);
1984-11-29 14:22:02 +00:00
}
String* _mkd(double d)
1984-11-29 14:22:02 +00:00
{
char* buffer = " ";
String* s;
1984-11-29 14:22:02 +00:00
s = _newstr(buffer);
*((double*)s->strval) = d;
return (s);
1984-11-29 14:22:02 +00:00
}
2016-12-12 20:15:25 +00:00
long _cvi(String* s)
1984-11-29 14:22:02 +00:00
{
return *((long*)s->strval);
1984-11-29 14:22:02 +00:00
}
2016-12-12 20:15:25 +00:00
double _cvd(String* s)
1984-11-29 14:22:02 +00:00
{
return *((double*)s->strval);
1984-11-29 14:22:02 +00:00
}