1.1 --- a/templates/native/int.c Wed Jul 11 23:53:09 2018 +0200
1.2 +++ b/templates/native/int.c Thu Jul 12 00:15:16 2018 +0200
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for integer operations.
1.5
1.6 -Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
1.8
1.9 This program is free software; you can redistribute it and/or modify it under
1.10 the terms of the GNU General Public License as published by the Free Software
1.11 @@ -290,6 +290,14 @@
1.12 return __new_str(s, strlen(s));
1.13 }
1.14
1.15 +__attr __fn_native_int_int_float(__attr __self, __attr self)
1.16 +{
1.17 + /* self interpreted as int */
1.18 + int i = __TOINT(self);
1.19 +
1.20 + return __new_float((double) i);
1.21 +}
1.22 +
1.23 /* Module initialisation. */
1.24
1.25 void __main_native_int()