mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Make more of the builtins do promotion from int to double for convenience.
This commit is contained in:
committed by
Christoffer Lerno
parent
50b0958fb6
commit
2123e81e8e
@@ -13,7 +13,7 @@ fn void main()
|
||||
|
||||
fn VarString bin(int x)
|
||||
{
|
||||
int bits = 1 + (int)(x == 0 ? 0 : math::log10((double)(x)) / math::log10(2));
|
||||
int bits = x == 0 ? 1 : 1 + (int)math::log2(x);
|
||||
VarString str;
|
||||
str.append_repeat('0', bits);
|
||||
for (int i = 0; i < bits; i++)
|
||||
|
||||
Reference in New Issue
Block a user