- # Required string length to hold `self` with `nb` decimals
- #
- # The length does not include the terminating null byte.
- private fun to_precision_size(nb: Int): Int `{
- return snprintf(NULL, 0, "%.*f", (int)nb, self);
- `}
-
- # Fill `cstr` with `self` and `nb` decimals
- private fun to_precision_fill(nb, size: Int, cstr: CString) `{
- snprintf(cstr, size, "%.*f", (int)nb, self);
- `}
-
- # The lenght of `self` in exponential hexadecimal notation
- private fun to_precision_size_hexa: Int`{
- return snprintf(NULL, 0, "%a", self);
- `}
-
- # Fill `cstr` with `self` in exponential hexadecimal notation
- private fun to_precision_fill_hexa(size: Int, cstr: CString) `{
- snprintf(cstr, size, "%a", self);
- `}
-