mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fixed multi line error reporting for tokens. Handle infinite empty for loops. Changed cast syntax to "cast(foo as Foo)". Completed enum casts. Added more tests.
This commit is contained in:
committed by
Christoffer Lerno
parent
e3566ba838
commit
34c7df9ee1
@@ -10,8 +10,8 @@ func int main()
|
||||
|
||||
func string bin(int x)
|
||||
{
|
||||
int bits = (x == 0) ? 1 : log10(cast(x, double)) / log10(2);
|
||||
string ret = str.make_repeat('0', bits);
|
||||
int bits = (x == 0) ? 1 : log10(cast(x as double)) / log10(2);
|
||||
string ret = str.make_repeat('0' as bits);
|
||||
for (int i = 0; i < bits; i++)
|
||||
{
|
||||
ret[bits - i - 1] = x & 1 ? '1' : '0';
|
||||
|
||||
Reference in New Issue
Block a user