IntToStr
IntToStr
Description
Convert an integer to a decimal string.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Integer to convert |
Usage example (from documentation)
Str text = IntToStr(&value);Returns
Decimal representation of the integer.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:899:
static Str FloatFmtToScientificStr(Float *value, u32 precision, bool has_precision, bool uppercase) {
Str digits = IntToStr(&value->significand);
Str result = StrInit();
u64 frac_digits = 0;- In
Io.c:2639:
if (radix == 10) {
temp = IntToStr(value);
} else {
temp = IntToStrRadix(value, radix, (fmt_info->flags & FMT_FLAG_CAPS) != 0);- In
Float.c:349:
}
digits = IntToStr(&value->significand);
if (value->negative) {- In
Int.c:495:
}
Str IntToStr(Int *value) {
return IntToStrRadix(value, 10, false);
} const char *digits = "123456789012345678901234567890";
Int value = IntFromStr(digits);
Str text = IntToStr(&value);
bool result = strcmp(text.data, digits) == 0;- In
Io.Read.c:904:
z = "123456789012345678901234567890";
StrReadFmt(z, "{}", dec);
dec_text = IntToStr(&dec);
success = success && (ZstrCompare(dec_text.data, "123456789012345678901234567890") == 0);
bool result = FloatToInt(&result_value, &value);
text = IntToStr(&result_value);
result = result && (strcmp(text.data, "12345") == 0);- In
Int.Math.c:129:
IntAdd(&result_value, &huge, 10);
text = IntToStr(&result_value);
result = result && (strcmp(text.data, "123456789012345678901234567900") == 0);- In
Int.Math.c:176:
result = result && IntSub(&result_value, &huge, 90);
text = IntToStr(&result_value);
result = result && (strcmp(text.data, "12345678901234567800") == 0);- In
Int.Math.c:232:
IntMul(&result_value, &value, 25u);
text = IntToStr(&result_value);
bool result = strcmp(text.data, "308641972530864197250") == 0;- In
Int.Math.c:284:
IntPow(&result_value, &base, 20u);
text = IntToStr(&result_value);
bool result = strcmp(text.data, "79792266297612001") == 0;- In
Int.Math.c:289:
StrDeinit(&text);
IntPow(&result_value, &base, exponent);
text = IntToStr(&result_value);
result = result && (strcmp(text.data, "79792266297612001") == 0);- In
Int.Math.c:308:
IntDivMod("ient, &remainder, ÷nd, 97u);
qtext = IntToStr("ient);
bool result = strcmp(qtext.data, "127275040218913071") == 0;- In
Int.Math.c:343:
bool result = IntDivExact(&result_value, ÷nd, 90u);
text = IntToStr(&result_value);
result = result && (strcmp(text.data, "137174210013717421") == 0);- In
Int.Math.c:377:
IntDivMod("ient, &remainder, ÷nd, 97);
text = IntToStr("ient);
bool result = strcmp(text.data, "127275040218913071") == 0;- In
Int.Math.c:778:
IntNextPrime(&next, &value);
text = IntToStr(&next);
bool result = strcmp(text.data, "1000000007") == 0;
Last updated on