2369 lines
67 KiB
C
2369 lines
67 KiB
C
/* Generated by Nim Compiler v1.9.0 */
|
|
#define NIM_INTBITS 64
|
|
|
|
#include "nimbase.h"
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#undef LANGUAGE_C
|
|
#undef MIPSEB
|
|
#undef MIPSEL
|
|
#undef PPC
|
|
#undef R3000
|
|
#undef R4000
|
|
#undef i386
|
|
#undef linux
|
|
#undef mips
|
|
#undef near
|
|
#undef far
|
|
#undef powerpc
|
|
#undef unix
|
|
#define nimfr_(x, y)
|
|
#define nimln_(x, y)
|
|
typedef struct NimStrPayload NimStrPayload;
|
|
typedef struct NimStringV2 NimStringV2;
|
|
typedef struct tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw;
|
|
typedef struct tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg;
|
|
typedef struct tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw;
|
|
typedef struct tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA;
|
|
typedef struct tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ;
|
|
typedef struct tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg;
|
|
struct NimStrPayload {
|
|
NI cap;
|
|
NIM_CHAR data[SEQ_DECL_SIZE];
|
|
};
|
|
struct NimStringV2 {
|
|
NI len;
|
|
NimStrPayload* p;
|
|
};
|
|
typedef NIM_CHAR tyArray__eVNFTutn6un5gcq48fQLdg[65];
|
|
struct tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw {
|
|
NU64 bits;
|
|
};
|
|
struct tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg {
|
|
NU64 significand;
|
|
NI32 exponent;
|
|
};
|
|
struct tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw {
|
|
NU64 hi;
|
|
NU64 lo;
|
|
};
|
|
typedef tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw tyArray__YxVLJbmWgWA9aXEi5wDoQhA[619];
|
|
struct tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA {
|
|
NU64 mul;
|
|
NU64 cmp;
|
|
};
|
|
typedef tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA tyArray__9apbx8OXkiOk9cnMKRpy11KQ[25];
|
|
typedef NIM_CHAR tyArray__38Z69amCaoywES5tRmClBSw[200];
|
|
typedef NI8 tyArray__k7wgHIN8mKeRF236nmwvnQ[100];
|
|
typedef NIM_CHAR tyArray__Wfh9bjgBQ4UqJsyISUuDSuA[16];
|
|
struct tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ {
|
|
NU32 bits;
|
|
};
|
|
struct tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg {
|
|
NU32 digits;
|
|
NI32 exponent;
|
|
};
|
|
typedef NU64 tyArray__ocdlWeLAycDNOOtB9cadACA[77];
|
|
N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferRoundtrip__stdZformatfloat_14)(NIM_CHAR* buf, NF value);
|
|
static N_INLINE(NI, toChars__stdZprivateZdragonbox_609)(NIM_CHAR* buffer, NI bufferLen_0, NF v, NIM_BOOL forceTrailingDotZero);
|
|
N_LIB_PRIVATE N_NIMCALL(NU64, physicalSignificand__stdZprivateZdragonbox_35)(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw this_0);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw, constructDouble__stdZprivateZdragonbox_32)(NF value);
|
|
N_LIB_PRIVATE N_NIMCALL(NU64, physicalExponent__stdZprivateZdragonbox_38)(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw this_0);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, signBit__stdZprivateZdragonbox_57)(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw this_0);
|
|
static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64__stdZprivateZdragonbox_361)(NU64 ieeeSignificand, NU64 ieeeExponent);
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size);
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
|
|
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
|
|
static N_INLINE(NIM_BOOL, multipleOfPow2__stdZprivateZdragonbox_149)(NU64 value, NI32 e2);
|
|
static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64AsymmetricInterval__stdZprivateZdragonbox_214)(NI32 e2);
|
|
static N_INLINE(NI32, floorLog10ThreeQuartersPow2__stdZprivateZdragonbox_89)(NI32 e);
|
|
static N_INLINE(NI32, floorDivPow2__stdZprivateZdragonbox_63)(NI32 x, NI32 n);
|
|
static N_INLINE(NI32, floorLog2Pow10__stdZprivateZdragonbox_71)(NI32 e);
|
|
static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, computePow10__stdZprivateZdragonbox_101)(NI32 k);
|
|
static N_INLINE(NI32, floorLog10Pow2__stdZprivateZdragonbox_80)(NI32 e);
|
|
static N_INLINE(NU32, computeDelta__stdZprivateZdragonbox_275)(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1);
|
|
static N_INLINE(NU64, mulShift__stdZprivateZdragonbox_315)(NU64 x, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw y);
|
|
static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, mul128__stdZprivateZdragonbox_299)(NU64 a, NU64 b);
|
|
static N_INLINE(NU32, lo32__stdZprivateZdragonbox_289)(NU64 x);
|
|
static N_INLINE(NU32, hi32__stdZprivateZdragonbox_292)(NU64 x);
|
|
static N_INLINE(NIM_BOOL, isIntegralEndpoint__stdZprivateZdragonbox_351)(NU64 twoF, NI32 e2, NI32 minusK);
|
|
static N_INLINE(NIM_BOOL, multipleOfPow5__stdZprivateZdragonbox_160)(NU64 value, NI32 e5);
|
|
static N_INLINE(NIM_BOOL, mulParity__stdZprivateZdragonbox_333)(NU64 twoF, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1);
|
|
static N_INLINE(NIM_BOOL, isIntegralMidpoint__stdZprivateZdragonbox_356)(NU64 twoF, NI32 e2, NI32 minusK);
|
|
static N_INLINE(NI, formatDigits__stdZprivateZdragonbox_623)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU64 digits, NI decimalExponent, NIM_BOOL forceTrailingDotZero);
|
|
static N_INLINE(NI, decimalLength__stdZprivateZdragonbox_570)(NU64 v);
|
|
static N_INLINE(NI32, printDecimalDigitsBackwards__stdZprivateZdragonbox_445)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU64 output64);
|
|
static N_INLINE(NI32, utoa8DigitsSkipTrailingZeros__stdZprivateZdragonbox_428)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits);
|
|
static N_INLINE(void, utoa2Digits__stdZprivateZdigitsutils_27)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits);
|
|
static N_INLINE(NI32, trailingZeros2Digits__stdZprivateZdigitsutils_43)(NU32 digits);
|
|
N_LIB_PRIVATE N_NIMCALL(void, addCstringN__stdZformatfloat_6)(NimStringV2* result, NCSTRING buf, NI buflen);
|
|
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s, NI newLen);
|
|
static N_INLINE(void, addFloat__system_4370)(NimStringV2* result, NF x);
|
|
N_LIB_PRIVATE N_NIMCALL(void, addFloatRoundtrip__system_4375)(NimStringV2* result, NF x);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferSprintf__stdZformatfloat_70)(NIM_CHAR* buf, NF value);
|
|
N_LIB_PRIVATE N_NIMCALL(void, writeToBuffer__stdZformatfloat_61)(NIM_CHAR* buf, NCSTRING value);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferRoundtrip__stdZformatfloat_54)(NIM_CHAR* buf, NF32 value);
|
|
static N_INLINE(NI, float32ToChars__stdZprivateZschubfach_266)(NIM_CHAR* buffer, NI bufferLen_0, NF32 v, NIM_BOOL forceTrailingDotZero);
|
|
N_LIB_PRIVATE N_NIMCALL(NU32, physicalSignificand__stdZprivateZschubfach_35)(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ this_0);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ, constructSingle__stdZprivateZschubfach_32)(NF32 value);
|
|
N_LIB_PRIVATE N_NIMCALL(NU32, physicalExponent__stdZprivateZschubfach_38)(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ this_0);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, signBit__stdZprivateZschubfach_57)(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ this_0);
|
|
static N_INLINE(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg, toDecimal32__stdZprivateZschubfach_149)(NU32 ieeeSignificand, NU32 ieeeExponent);
|
|
static N_INLINE(NIM_BOOL, multipleOfPow2__stdZprivateZschubfach_132)(NU32 value, NI32 e2);
|
|
static N_INLINE(NI32, floorDivPow2__stdZprivateZschubfach_60)(NI32 x, NI32 n);
|
|
static N_INLINE(NI32, floorLog2Pow10__stdZprivateZschubfach_68)(NI32 e);
|
|
static N_INLINE(NU64, computePow10Single__stdZprivateZschubfach_92)(NI32 k);
|
|
static N_INLINE(NU32, roundToOdd__stdZprivateZschubfach_123)(NU64 g, NU32 cp);
|
|
static N_INLINE(NU32, lo32__stdZprivateZschubfach_113)(NU64 x);
|
|
static N_INLINE(NU32, hi32__stdZprivateZschubfach_116)(NU64 x);
|
|
static N_INLINE(NI, formatDigits__stdZprivateZschubfach_280)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU32 digits, NI decimalExponent, NIM_BOOL forceTrailingDotZero);
|
|
static N_INLINE(NI, decimalLength__stdZprivateZschubfach_236)(NU32 v);
|
|
static N_INLINE(NI32, printDecimalDigitsBackwards__stdZprivateZschubfach_325)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 output);
|
|
extern NIM_CONST tyArray__YxVLJbmWgWA9aXEi5wDoQhA pow10__stdZprivateZdragonbox_106;
|
|
extern NIM_CONST tyArray__9apbx8OXkiOk9cnMKRpy11KQ mod5__stdZprivateZdragonbox_167;
|
|
extern NIM_CONST tyArray__38Z69amCaoywES5tRmClBSw digits100__stdZprivateZdigitsutils_2;
|
|
extern NIM_CONST tyArray__k7wgHIN8mKeRF236nmwvnQ trailingZeros100__stdZprivateZdigitsutils_1;
|
|
extern NIM_CONST tyArray__ocdlWeLAycDNOOtB9cadACA g__stdZprivateZschubfach_79;
|
|
extern NIM_BOOL nimInErrorMode__system_3978;
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
|
|
void* T1_;
|
|
T1_ = (void*)0;
|
|
T1_ = memset(a, v, ((size_t) (size)));
|
|
}
|
|
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
|
|
NIM_BOOL* result;
|
|
result = (NIM_BOOL*)0;
|
|
result = (&nimInErrorMode__system_3978);
|
|
return result;
|
|
}
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimSetMem__systemZmemory_7(p, ((int)0), size);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
static N_INLINE(NIM_BOOL, multipleOfPow2__stdZprivateZdragonbox_149)(NU64 value, NI32 e2) {
|
|
NIM_BOOL result;
|
|
NIM_BOOL T1_;
|
|
{ result = (NIM_BOOL)0;
|
|
T1_ = (NIM_BOOL)0;
|
|
T1_ = (e2 < ((NI32)64));
|
|
if (!(T1_)) goto LA2_;
|
|
T1_ = ((NU64)(value & (NU64)((NU64)((NU64)((NU64)(1ULL) << (NU64)(e2))) - (NU64)(1ULL))) == 0ULL);
|
|
LA2_: ;
|
|
result = T1_;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, floorDivPow2__stdZprivateZdragonbox_63)(NI32 x, NI32 n) {
|
|
NI32 result;
|
|
{ result = (NI32)0;
|
|
result = (NI32)((NI32)(x) >> (NU32)(n));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, floorLog10ThreeQuartersPow2__stdZprivateZdragonbox_89)(NI32 e) {
|
|
NI32 result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI32)0;
|
|
result = floorDivPow2__stdZprivateZdragonbox_63((NI32)((NI32)(e * ((NI32)1262611)) - ((NI32)524031)), ((NI32)22));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, floorLog2Pow10__stdZprivateZdragonbox_71)(NI32 e) {
|
|
NI32 result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI32)0;
|
|
result = floorDivPow2__stdZprivateZdragonbox_63((NI32)(e * ((NI32)1741647)), ((NI32)19));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, computePow10__stdZprivateZdragonbox_101)(NI32 k) {
|
|
tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw result;
|
|
{ nimZeroMem((void*)(&result), sizeof(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw));
|
|
result = pow10__stdZprivateZdragonbox_106[((NI32)(k - ((NI32)-292)))- 0];
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64AsymmetricInterval__stdZprivateZdragonbox_214)(NI32 e2) {
|
|
tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg result;
|
|
NI32 minusK;
|
|
NI32 betaMinus1;
|
|
NI32 T1_;
|
|
tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10;
|
|
NU64 lowerEndpoint;
|
|
NU64 upperEndpoint;
|
|
NIM_BOOL lowerEndpointIsInteger;
|
|
NIM_BOOL T2_;
|
|
NU64 xi;
|
|
NU64 zi;
|
|
NU64 q;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
minusK = floorLog10ThreeQuartersPow2__stdZprivateZdragonbox_89(e2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T1_ = (NI32)0;
|
|
T1_ = floorLog2Pow10__stdZprivateZdragonbox_71(((NI32)-(minusK)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
betaMinus1 = (NI32)(e2 + T1_);
|
|
pow10 = computePow10__stdZprivateZdragonbox_101(((NI32)-(minusK)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
lowerEndpoint = (NU64)((NU64)((NU64)((NU64)(pow10.hi) - (NU64)((NU64)((NU64)(pow10.hi) >> (NU64)(((NI32)54)))))) >> (NU64)((NI32)(((NI32)11) - betaMinus1)));
|
|
upperEndpoint = (NU64)((NU64)((NU64)((NU64)(pow10.hi) + (NU64)((NU64)((NU64)(pow10.hi) >> (NU64)(((NI32)53)))))) >> (NU64)((NI32)(((NI32)11) - betaMinus1)));
|
|
T2_ = (NIM_BOOL)0;
|
|
T2_ = (((NI32)2) <= e2);
|
|
if (!(T2_)) goto LA3_;
|
|
T2_ = (e2 <= ((NI32)3));
|
|
LA3_: ;
|
|
lowerEndpointIsInteger = T2_;
|
|
xi = (NU64)((NU64)(lowerEndpoint) + (NU64)(((NU64) (!(lowerEndpointIsInteger)))));
|
|
zi = upperEndpoint;
|
|
q = (NU64)((NU64)(zi) / (NU64)(10ULL));
|
|
{
|
|
if (!((NU64)(xi) <= (NU64)((NU64)((NU64)(q) * (NU64)(10ULL))))) goto LA6_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
result.significand = q;
|
|
result.exponent = (NI32)(minusK + ((NI32)1));
|
|
goto BeforeRet_;
|
|
}
|
|
LA6_: ;
|
|
q = (NU64)((NU64)((NU64)((NU64)((NU64)((NU64)(pow10.hi) >> (NU64)((NI32)(((NI32)10) - betaMinus1)))) + (NU64)(1ULL))) / (NU64)(2ULL));
|
|
{
|
|
if (!(e2 == ((NI32)-77))) goto LA10_;
|
|
q -= !(((NU64)((NU64)(q) % (NU64)(2ULL)) == 0ULL));
|
|
}
|
|
goto LA8_;
|
|
LA10_: ;
|
|
{
|
|
q += ((NU64)(q) < (NU64)(xi));
|
|
}
|
|
LA8_: ;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
result.significand = q;
|
|
result.exponent = minusK;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, floorLog10Pow2__stdZprivateZdragonbox_80)(NI32 e) {
|
|
NI32 result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI32)0;
|
|
result = floorDivPow2__stdZprivateZdragonbox_63((NI32)(e * ((NI32)1262611)), ((NI32)22));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU32, computeDelta__stdZprivateZdragonbox_275)(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1) {
|
|
NU32 result;
|
|
{ result = (NU32)0;
|
|
result = ((NU32) ((NU64)((NU64)(pow10.hi) >> (NU64)((NI32)(((NI32)63) - betaMinus1)))));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU32, lo32__stdZprivateZdragonbox_289)(NU64 x) {
|
|
NU32 result;
|
|
{ result = (NU32)0;
|
|
result = ((NU32) (x));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU32, hi32__stdZprivateZdragonbox_292)(NU64 x) {
|
|
NU32 result;
|
|
{ result = (NU32)0;
|
|
result = ((NU32) ((NU64)((NU64)(x) >> (NU64)(((NI)32)))));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, mul128__stdZprivateZdragonbox_299)(NU64 a, NU64 b) {
|
|
tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw result;
|
|
NU64 b00;
|
|
NU32 T1_;
|
|
NU32 T2_;
|
|
NU64 b01;
|
|
NU32 T3_;
|
|
NU32 T4_;
|
|
NU64 b10;
|
|
NU32 T5_;
|
|
NU32 T6_;
|
|
NU64 b11;
|
|
NU32 T7_;
|
|
NU32 T8_;
|
|
NU64 mid1;
|
|
NU32 T9_;
|
|
NU64 mid2;
|
|
NU32 T10_;
|
|
NU64 hi;
|
|
NU32 T11_;
|
|
NU32 T12_;
|
|
NU64 lo;
|
|
NU32 T13_;
|
|
NU32 T14_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw));
|
|
T1_ = (NU32)0;
|
|
T1_ = lo32__stdZprivateZdragonbox_289(a);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T2_ = (NU32)0;
|
|
T2_ = lo32__stdZprivateZdragonbox_289(b);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
b00 = (NU64)((NU64)(((NU64) (T1_))) * (NU64)(((NU64) (T2_))));
|
|
T3_ = (NU32)0;
|
|
T3_ = lo32__stdZprivateZdragonbox_289(a);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T4_ = (NU32)0;
|
|
T4_ = hi32__stdZprivateZdragonbox_292(b);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
b01 = (NU64)((NU64)(((NU64) (T3_))) * (NU64)(((NU64) (T4_))));
|
|
T5_ = (NU32)0;
|
|
T5_ = hi32__stdZprivateZdragonbox_292(a);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T6_ = (NU32)0;
|
|
T6_ = lo32__stdZprivateZdragonbox_289(b);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
b10 = (NU64)((NU64)(((NU64) (T5_))) * (NU64)(((NU64) (T6_))));
|
|
T7_ = (NU32)0;
|
|
T7_ = hi32__stdZprivateZdragonbox_292(a);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T8_ = (NU32)0;
|
|
T8_ = hi32__stdZprivateZdragonbox_292(b);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
b11 = (NU64)((NU64)(((NU64) (T7_))) * (NU64)(((NU64) (T8_))));
|
|
T9_ = (NU32)0;
|
|
T9_ = hi32__stdZprivateZdragonbox_292(b00);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
mid1 = (NU64)((NU64)(b10) + (NU64)(((NU64) (T9_))));
|
|
T10_ = (NU32)0;
|
|
T10_ = lo32__stdZprivateZdragonbox_289(mid1);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
mid2 = (NU64)((NU64)(b01) + (NU64)(((NU64) (T10_))));
|
|
T11_ = (NU32)0;
|
|
T11_ = hi32__stdZprivateZdragonbox_292(mid1);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T12_ = (NU32)0;
|
|
T12_ = hi32__stdZprivateZdragonbox_292(mid2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
hi = (NU64)((NU64)((NU64)((NU64)(b11) + (NU64)(((NU64) (T11_))))) + (NU64)(((NU64) (T12_))));
|
|
T13_ = (NU32)0;
|
|
T13_ = lo32__stdZprivateZdragonbox_289(b00);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T14_ = (NU32)0;
|
|
T14_ = lo32__stdZprivateZdragonbox_289(mid2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
lo = (NU64)(((NU64) (T13_)) | (NU64)((NU64)(((NU64) (T14_))) << (NU64)(((NI)32))));
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw));
|
|
result.hi = hi;
|
|
result.lo = lo;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU64, mulShift__stdZprivateZdragonbox_315)(NU64 x, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw y) {
|
|
NU64 result;
|
|
tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw p1;
|
|
tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw p0;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NU64)0;
|
|
p1 = mul128__stdZprivateZdragonbox_299(x, y.hi);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
p0 = mul128__stdZprivateZdragonbox_299(x, y.lo);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
p1.lo += p0.hi;
|
|
p1.hi += ((NU64)(p1.lo) < (NU64)(p0.hi));
|
|
result = p1.hi;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, multipleOfPow5__stdZprivateZdragonbox_160)(NU64 value, NI32 e5) {
|
|
NIM_BOOL result;
|
|
tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA m5;
|
|
{ result = (NIM_BOOL)0;
|
|
m5 = mod5__stdZprivateZdragonbox_167[(e5)- 0];
|
|
result = ((NU64)((NU64)((NU64)(value) * (NU64)(m5.mul))) <= (NU64)(m5.cmp));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, isIntegralEndpoint__stdZprivateZdragonbox_351)(NU64 twoF, NI32 e2, NI32 minusK) {
|
|
NIM_BOOL result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
{
|
|
if (!(e2 < ((NI32)-2))) goto LA3_;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
{
|
|
if (!(e2 <= ((NI32)9))) goto LA7_;
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
{
|
|
if (!(e2 <= ((NI32)86))) goto LA11_;
|
|
result = multipleOfPow5__stdZprivateZdragonbox_160(twoF, minusK);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, mulParity__stdZprivateZdragonbox_333)(NU64 twoF, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1) {
|
|
NIM_BOOL result;
|
|
NU64 p01;
|
|
NU64 p10;
|
|
tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw T1_;
|
|
NU64 mid;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
p01 = (NU64)((NU64)(twoF) * (NU64)(pow10.hi));
|
|
T1_ = mul128__stdZprivateZdragonbox_299(twoF, pow10.lo);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
p10 = T1_.hi;
|
|
mid = (NU64)((NU64)(p01) + (NU64)(p10));
|
|
result = !(((NU64)(mid & (NU64)((NU64)(1ULL) << (NU64)((NI32)(((NI32)64) - betaMinus1)))) == 0ULL));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, isIntegralMidpoint__stdZprivateZdragonbox_356)(NU64 twoF, NI32 e2, NI32 minusK) {
|
|
NIM_BOOL result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
{
|
|
if (!(e2 < ((NI32)-4))) goto LA3_;
|
|
result = multipleOfPow2__stdZprivateZdragonbox_149(twoF, (NI32)((NI32)(minusK - e2) + ((NI32)1)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
{
|
|
if (!(e2 <= ((NI32)9))) goto LA7_;
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
{
|
|
if (!(e2 <= ((NI32)86))) goto LA11_;
|
|
result = multipleOfPow5__stdZprivateZdragonbox_160(twoF, minusK);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64__stdZprivateZdragonbox_361)(NU64 ieeeSignificand, NU64 ieeeExponent) {
|
|
tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg result;
|
|
NU64 m2;
|
|
NI32 e2;
|
|
NIM_BOOL isEven;
|
|
NIM_BOOL acceptLower;
|
|
NIM_BOOL acceptUpper;
|
|
NI32 minusK;
|
|
NI32 T20_;
|
|
NI32 betaMinus1;
|
|
NI32 T21_;
|
|
tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10;
|
|
NU32 delta;
|
|
NU64 twoFl;
|
|
NU64 twoFc;
|
|
NU64 twoFr;
|
|
NU64 zi;
|
|
NU64 q;
|
|
NU32 r;
|
|
NU32 dist;
|
|
NU32 distQ;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
m2 = (NU64)0;
|
|
e2 = (NI32)0;
|
|
{
|
|
if (!!((ieeeExponent == 0ULL))) goto LA3_;
|
|
m2 = (NU64)(4503599627370496ULL | ieeeSignificand);
|
|
e2 = (NI32)(((NI32) (ieeeExponent)) - ((NI32)1075));
|
|
{
|
|
NIM_BOOL T7_;
|
|
NIM_BOOL T8_;
|
|
T7_ = (NIM_BOOL)0;
|
|
T8_ = (NIM_BOOL)0;
|
|
T8_ = (((NI32)0) <= ((NI32)-(e2)));
|
|
if (!(T8_)) goto LA9_;
|
|
T8_ = (((NI32)-(e2)) < ((NI32)53));
|
|
LA9_: ;
|
|
T7_ = T8_;
|
|
if (!(T7_)) goto LA10_;
|
|
T7_ = multipleOfPow2__stdZprivateZdragonbox_149(m2, ((NI32)-(e2)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
LA10_: ;
|
|
if (!T7_) goto LA11_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
result.significand = (NU64)((NU64)(m2) >> (NU64)(((NI32)-(e2))));
|
|
result.exponent = ((NI32)0);
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
{
|
|
NIM_BOOL T15_;
|
|
T15_ = (NIM_BOOL)0;
|
|
T15_ = (ieeeSignificand == 0ULL);
|
|
if (!(T15_)) goto LA16_;
|
|
T15_ = ((NU64)(1ULL) < (NU64)(ieeeExponent));
|
|
LA16_: ;
|
|
if (!T15_) goto LA17_;
|
|
result = toDecimal64AsymmetricInterval__stdZprivateZdragonbox_214(e2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA17_: ;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
m2 = ieeeSignificand;
|
|
e2 = ((NI32)-1074);
|
|
}
|
|
LA1_: ;
|
|
isEven = ((NU64)((NU64)(m2) % (NU64)(2ULL)) == 0ULL);
|
|
acceptLower = isEven;
|
|
acceptUpper = isEven;
|
|
T20_ = (NI32)0;
|
|
T20_ = floorLog10Pow2__stdZprivateZdragonbox_80(e2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
minusK = (NI32)(T20_ - ((NI32)2));
|
|
T21_ = (NI32)0;
|
|
T21_ = floorLog2Pow10__stdZprivateZdragonbox_71(((NI32)-(minusK)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
betaMinus1 = (NI32)(e2 + T21_);
|
|
pow10 = computePow10__stdZprivateZdragonbox_101(((NI32)-(minusK)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
delta = computeDelta__stdZprivateZdragonbox_275(pow10, betaMinus1);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
twoFl = (NU64)((NU64)((NU64)((NU64)(2ULL) * (NU64)(m2))) - (NU64)(1ULL));
|
|
twoFc = (NU64)((NU64)(2ULL) * (NU64)(m2));
|
|
twoFr = (NU64)((NU64)((NU64)((NU64)(2ULL) * (NU64)(m2))) + (NU64)(1ULL));
|
|
zi = mulShift__stdZprivateZdragonbox_315((NU64)((NU64)(twoFr) << (NU64)(betaMinus1)), pow10);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
q = (NU64)((NU64)(zi) / (NU64)(1000ULL));
|
|
r = (NU32)((NU32)(((NU32) (zi))) - (NU32)((NU32)((NU32)(((NU32)1000)) * (NU32)(((NU32) (q))))));
|
|
{
|
|
if (!((NU32)(r) < (NU32)(delta))) goto LA24_;
|
|
{
|
|
NIM_BOOL T28_;
|
|
NIM_BOOL T29_;
|
|
NIM_BOOL T32_;
|
|
T28_ = (NIM_BOOL)0;
|
|
T29_ = (NIM_BOOL)0;
|
|
T29_ = !((r == ((NU32)0)));
|
|
if (T29_) goto LA30_;
|
|
T29_ = acceptUpper;
|
|
LA30_: ;
|
|
T28_ = T29_;
|
|
if (T28_) goto LA31_;
|
|
T32_ = (NIM_BOOL)0;
|
|
T32_ = isIntegralEndpoint__stdZprivateZdragonbox_351(twoFr, e2, minusK);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T28_ = !(T32_);
|
|
LA31_: ;
|
|
if (!T28_) goto LA33_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
result.significand = q;
|
|
result.exponent = (NI32)((NI32)(minusK + ((NI32)2)) + ((NI32)1));
|
|
goto BeforeRet_;
|
|
}
|
|
LA33_: ;
|
|
q -= ((NI)1);
|
|
r = ((NU32)1000);
|
|
}
|
|
goto LA22_;
|
|
LA24_: ;
|
|
{
|
|
if (!(r == delta)) goto LA36_;
|
|
{
|
|
NIM_BOOL T40_;
|
|
NIM_BOOL T41_;
|
|
T40_ = (NIM_BOOL)0;
|
|
T41_ = (NIM_BOOL)0;
|
|
T41_ = acceptLower;
|
|
if (!(T41_)) goto LA42_;
|
|
T41_ = isIntegralEndpoint__stdZprivateZdragonbox_351(twoFl, e2, minusK);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
LA42_: ;
|
|
T40_ = T41_;
|
|
if (T40_) goto LA43_;
|
|
T40_ = mulParity__stdZprivateZdragonbox_333(twoFl, pow10, betaMinus1);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
LA43_: ;
|
|
if (!T40_) goto LA44_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
result.significand = q;
|
|
result.exponent = (NI32)((NI32)(minusK + ((NI32)2)) + ((NI32)1));
|
|
goto BeforeRet_;
|
|
}
|
|
LA44_: ;
|
|
}
|
|
goto LA22_;
|
|
LA36_: ;
|
|
{
|
|
}
|
|
LA22_: ;
|
|
q = (NU64)((NU64)(q) * (NU64)(10ULL));
|
|
dist = (NU32)((NU32)((NU32)((NU32)(r) - (NU32)((NU32)((NU32)(delta) / (NU32)(((NU32)2)))))) + (NU32)(((NU32)50)));
|
|
distQ = (NU32)((NU32)(dist) / (NU32)(((NU32)100)));
|
|
q += ((NU64) (distQ));
|
|
{
|
|
NIM_BOOL approxYParity;
|
|
if (!(dist == (NU32)((NU32)(distQ) * (NU32)(((NU32)100))))) goto LA49_;
|
|
approxYParity = !(((NU32)(dist & ((NU32)1)) == ((NU32)0)));
|
|
{
|
|
NIM_BOOL T53_;
|
|
T53_ = (NIM_BOOL)0;
|
|
T53_ = mulParity__stdZprivateZdragonbox_333(twoFc, pow10, betaMinus1);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!!((T53_ == approxYParity))) goto LA54_;
|
|
q -= ((NI)1);
|
|
}
|
|
goto LA51_;
|
|
LA54_: ;
|
|
{
|
|
NIM_BOOL T57_;
|
|
T57_ = (NIM_BOOL)0;
|
|
T57_ = !(((NU64)((NU64)(q) % (NU64)(2ULL)) == 0ULL));
|
|
if (!(T57_)) goto LA58_;
|
|
T57_ = isIntegralMidpoint__stdZprivateZdragonbox_356(twoFc, e2, minusK);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
LA58_: ;
|
|
if (!T57_) goto LA59_;
|
|
q -= ((NI)1);
|
|
}
|
|
goto LA51_;
|
|
LA59_: ;
|
|
LA51_: ;
|
|
}
|
|
LA49_: ;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
|
|
result.significand = q;
|
|
result.exponent = (NI32)(minusK + ((NI32)2));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, decimalLength__stdZprivateZdragonbox_570)(NU64 v) {
|
|
NI result;
|
|
NU32 v32;
|
|
{ result = (NI)0;
|
|
{
|
|
if (!!((((NU32) ((NU64)((NU64)(v) >> (NU64)(((NI)32))))) == ((NU32)0)))) goto LA3_;
|
|
{
|
|
if (!((NU64)(10000000000000000ULL) <= (NU64)(v))) goto LA7_;
|
|
result = ((NI)17);
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
{
|
|
if (!((NU64)(1000000000000000ULL) <= (NU64)(v))) goto LA11_;
|
|
result = ((NI)16);
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
{
|
|
if (!((NU64)(100000000000000ULL) <= (NU64)(v))) goto LA15_;
|
|
result = ((NI)15);
|
|
goto BeforeRet_;
|
|
}
|
|
LA15_: ;
|
|
{
|
|
if (!((NU64)(10000000000000ULL) <= (NU64)(v))) goto LA19_;
|
|
result = ((NI)14);
|
|
goto BeforeRet_;
|
|
}
|
|
LA19_: ;
|
|
{
|
|
if (!((NU64)(1000000000000ULL) <= (NU64)(v))) goto LA23_;
|
|
result = ((NI)13);
|
|
goto BeforeRet_;
|
|
}
|
|
LA23_: ;
|
|
{
|
|
if (!((NU64)(100000000000ULL) <= (NU64)(v))) goto LA27_;
|
|
result = ((NI)12);
|
|
goto BeforeRet_;
|
|
}
|
|
LA27_: ;
|
|
{
|
|
if (!((NU64)(10000000000ULL) <= (NU64)(v))) goto LA31_;
|
|
result = ((NI)11);
|
|
goto BeforeRet_;
|
|
}
|
|
LA31_: ;
|
|
result = ((NI)10);
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
v32 = ((NU32) (v));
|
|
{
|
|
if (!((NU32)(((NU32)1000000000)) <= (NU32)(v32))) goto LA35_;
|
|
result = ((NI)10);
|
|
goto BeforeRet_;
|
|
}
|
|
LA35_: ;
|
|
{
|
|
if (!((NU32)(((NU32)100000000)) <= (NU32)(v32))) goto LA39_;
|
|
result = ((NI)9);
|
|
goto BeforeRet_;
|
|
}
|
|
LA39_: ;
|
|
{
|
|
if (!((NU32)(((NU32)10000000)) <= (NU32)(v32))) goto LA43_;
|
|
result = ((NI)8);
|
|
goto BeforeRet_;
|
|
}
|
|
LA43_: ;
|
|
{
|
|
if (!((NU32)(((NU32)1000000)) <= (NU32)(v32))) goto LA47_;
|
|
result = ((NI)7);
|
|
goto BeforeRet_;
|
|
}
|
|
LA47_: ;
|
|
{
|
|
if (!((NU32)(((NU32)100000)) <= (NU32)(v32))) goto LA51_;
|
|
result = ((NI)6);
|
|
goto BeforeRet_;
|
|
}
|
|
LA51_: ;
|
|
{
|
|
if (!((NU32)(((NU32)10000)) <= (NU32)(v32))) goto LA55_;
|
|
result = ((NI)5);
|
|
goto BeforeRet_;
|
|
}
|
|
LA55_: ;
|
|
{
|
|
if (!((NU32)(((NU32)1000)) <= (NU32)(v32))) goto LA59_;
|
|
result = ((NI)4);
|
|
goto BeforeRet_;
|
|
}
|
|
LA59_: ;
|
|
{
|
|
if (!((NU32)(((NU32)100)) <= (NU32)(v32))) goto LA63_;
|
|
result = ((NI)3);
|
|
goto BeforeRet_;
|
|
}
|
|
LA63_: ;
|
|
{
|
|
if (!((NU32)(((NU32)10)) <= (NU32)(v32))) goto LA67_;
|
|
result = ((NI)2);
|
|
goto BeforeRet_;
|
|
}
|
|
LA67_: ;
|
|
result = ((NI)1);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(void, utoa2Digits__stdZprivateZdigitsutils_27)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits) {
|
|
buf[pos] = digits100__stdZprivateZdigitsutils_2[((NU32)((NU32)(((NU32)2)) * (NU32)(digits)))- 0];
|
|
buf[(NI)(pos + ((NI)1))] = digits100__stdZprivateZdigitsutils_2[((NU32)((NU32)((NU32)((NU32)(((NU32)2)) * (NU32)(digits))) + (NU32)(((NU32)1))))- 0];
|
|
}
|
|
static N_INLINE(NI32, trailingZeros2Digits__stdZprivateZdigitsutils_43)(NU32 digits) {
|
|
NI32 result;
|
|
{ result = (NI32)0;
|
|
result = ((NI32) (trailingZeros100__stdZprivateZdigitsutils_1[(((NI8) (digits)))- 0]));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, utoa8DigitsSkipTrailingZeros__stdZprivateZdragonbox_428)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits) {
|
|
NI32 result;
|
|
NU32 q;
|
|
NU32 r;
|
|
NU32 qH;
|
|
NU32 qL;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI32)0;
|
|
q = (NU32)((NU32)(digits) / (NU32)(((NU32)10000)));
|
|
r = (NU32)((NU32)(digits) % (NU32)(((NU32)10000)));
|
|
qH = (NU32)((NU32)(q) / (NU32)(((NU32)100)));
|
|
qL = (NU32)((NU32)(q) % (NU32)(((NU32)100)));
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos, qH);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, (NI)(pos + ((NI)2)), qL);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NU32 colontmpD_;
|
|
NU32 colontmpD__2;
|
|
NI colontmpD__3;
|
|
NI colontmpD__4;
|
|
NU32 T5_;
|
|
NI32 T11_;
|
|
NI T12_;
|
|
if (!(r == ((NU32)0))) goto LA3_;
|
|
colontmpD_ = (NU32)0;
|
|
colontmpD__2 = (NU32)0;
|
|
colontmpD__3 = (NI)0;
|
|
colontmpD__4 = (NI)0;
|
|
T5_ = (NU32)0;
|
|
{
|
|
if (!(qL == ((NU32)0))) goto LA8_;
|
|
colontmpD_ = qH;
|
|
T5_ = colontmpD_;
|
|
}
|
|
goto LA6_;
|
|
LA8_: ;
|
|
{
|
|
colontmpD__2 = qL;
|
|
T5_ = colontmpD__2;
|
|
}
|
|
LA6_: ;
|
|
T11_ = (NI32)0;
|
|
T11_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(T5_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T12_ = (NI)0;
|
|
{
|
|
if (!(qL == ((NU32)0))) goto LA15_;
|
|
colontmpD__3 = ((NI)6);
|
|
T12_ = colontmpD__3;
|
|
}
|
|
goto LA13_;
|
|
LA15_: ;
|
|
{
|
|
colontmpD__4 = ((NI)4);
|
|
T12_ = colontmpD__4;
|
|
}
|
|
LA13_: ;
|
|
result = (NI32)(T11_ + ((NI32) (T12_)));
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
NU32 colontmpD__5;
|
|
NU32 colontmpD__6;
|
|
NI colontmpD__7;
|
|
NI colontmpD__8;
|
|
NU32 rH;
|
|
NU32 rL;
|
|
NU32 T19_;
|
|
NI32 T25_;
|
|
NI T26_;
|
|
colontmpD__5 = (NU32)0;
|
|
colontmpD__6 = (NU32)0;
|
|
colontmpD__7 = (NI)0;
|
|
colontmpD__8 = (NI)0;
|
|
rH = (NU32)((NU32)(r) / (NU32)(((NU32)100)));
|
|
rL = (NU32)((NU32)(r) % (NU32)(((NU32)100)));
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, (NI)(pos + ((NI)4)), rH);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, (NI)(pos + ((NI)6)), rL);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T19_ = (NU32)0;
|
|
{
|
|
if (!(rL == ((NU32)0))) goto LA22_;
|
|
colontmpD__5 = rH;
|
|
T19_ = colontmpD__5;
|
|
}
|
|
goto LA20_;
|
|
LA22_: ;
|
|
{
|
|
colontmpD__6 = rL;
|
|
T19_ = colontmpD__6;
|
|
}
|
|
LA20_: ;
|
|
T25_ = (NI32)0;
|
|
T25_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(T19_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T26_ = (NI)0;
|
|
{
|
|
if (!(rL == ((NU32)0))) goto LA29_;
|
|
colontmpD__7 = ((NI)2);
|
|
T26_ = colontmpD__7;
|
|
}
|
|
goto LA27_;
|
|
LA29_: ;
|
|
{
|
|
colontmpD__8 = ((NI)0);
|
|
T26_ = colontmpD__8;
|
|
}
|
|
LA27_: ;
|
|
result = (NI32)(T25_ + ((NI32) (T26_)));
|
|
goto BeforeRet_;
|
|
}
|
|
LA1_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, printDecimalDigitsBackwards__stdZprivateZdragonbox_445)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU64 output64) {
|
|
NI32 result;
|
|
NI pos_2;
|
|
NU64 output64_2;
|
|
NI32 tz;
|
|
NI32 nd;
|
|
NU32 output;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI32)0;
|
|
pos_2 = pos;
|
|
output64_2 = output64;
|
|
tz = ((NI32)0);
|
|
nd = ((NI32)0);
|
|
{
|
|
NU64 q;
|
|
NU32 r;
|
|
if (!((NU64)(100000000ULL) <= (NU64)(output64_2))) goto LA3_;
|
|
q = (NU64)((NU64)(output64_2) / (NU64)(100000000ULL));
|
|
r = ((NU32) ((NU64)((NU64)(output64_2) % (NU64)(100000000ULL))));
|
|
output64_2 = q;
|
|
pos_2 -= ((NI)8);
|
|
{
|
|
if (!!((r == ((NU32)0)))) goto LA7_;
|
|
tz = utoa8DigitsSkipTrailingZeros__stdZprivateZdragonbox_428(buf, bufLen_0, pos_2, r);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{
|
|
tz = ((NI32)8);
|
|
}
|
|
LA5_: ;
|
|
nd = ((NI32)8);
|
|
}
|
|
LA3_: ;
|
|
output = ((NU32) (output64_2));
|
|
{
|
|
NU32 q_2;
|
|
NU32 r_2;
|
|
if (!((NU32)(((NU32)10000)) <= (NU32)(output))) goto LA12_;
|
|
q_2 = (NU32)((NU32)(output) / (NU32)(((NU32)10000)));
|
|
r_2 = (NU32)((NU32)(output) % (NU32)(((NU32)10000)));
|
|
output = q_2;
|
|
pos_2 -= ((NI)4);
|
|
{
|
|
NU32 rH;
|
|
NU32 rL;
|
|
if (!!((r_2 == ((NU32)0)))) goto LA16_;
|
|
rH = (NU32)((NU32)(r_2) / (NU32)(((NU32)100)));
|
|
rL = (NU32)((NU32)(r_2) % (NU32)(((NU32)100)));
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, rH);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, (NI)(pos_2 + ((NI)2)), rL);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NU32 colontmpD_;
|
|
NU32 colontmpD__2;
|
|
NI colontmpD__3;
|
|
NI colontmpD__4;
|
|
NU32 T22_;
|
|
NI32 T28_;
|
|
NI T29_;
|
|
if (!(tz == nd)) goto LA20_;
|
|
colontmpD_ = (NU32)0;
|
|
colontmpD__2 = (NU32)0;
|
|
colontmpD__3 = (NI)0;
|
|
colontmpD__4 = (NI)0;
|
|
T22_ = (NU32)0;
|
|
{
|
|
if (!(rL == ((NU32)0))) goto LA25_;
|
|
colontmpD_ = rH;
|
|
T22_ = colontmpD_;
|
|
}
|
|
goto LA23_;
|
|
LA25_: ;
|
|
{
|
|
colontmpD__2 = rL;
|
|
T22_ = colontmpD__2;
|
|
}
|
|
LA23_: ;
|
|
T28_ = (NI32)0;
|
|
T28_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(T22_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T29_ = (NI)0;
|
|
{
|
|
if (!(rL == ((NU32)0))) goto LA32_;
|
|
colontmpD__3 = ((NI)2);
|
|
T29_ = colontmpD__3;
|
|
}
|
|
goto LA30_;
|
|
LA32_: ;
|
|
{
|
|
colontmpD__4 = ((NI)0);
|
|
T29_ = colontmpD__4;
|
|
}
|
|
LA30_: ;
|
|
tz += (NI32)(T28_ + ((NI32) (T29_)));
|
|
}
|
|
LA20_: ;
|
|
}
|
|
goto LA14_;
|
|
LA16_: ;
|
|
{
|
|
{
|
|
if (!(tz == nd)) goto LA38_;
|
|
tz += ((NI)4);
|
|
}
|
|
goto LA36_;
|
|
LA38_: ;
|
|
{
|
|
{
|
|
NI i;
|
|
NI res;
|
|
i = (NI)0;
|
|
res = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(res <= ((NI)3))) goto LA43 ;
|
|
i = res;
|
|
buf[(NI)(pos_2 + i)] = 48;
|
|
res += ((NI)1);
|
|
} LA43: ;
|
|
}
|
|
}
|
|
}
|
|
LA36_: ;
|
|
}
|
|
LA14_: ;
|
|
nd += ((NI)4);
|
|
}
|
|
LA12_: ;
|
|
{
|
|
NU32 q_3;
|
|
NU32 r_3;
|
|
if (!((NU32)(((NU32)100)) <= (NU32)(output))) goto LA46_;
|
|
q_3 = (NU32)((NU32)(output) / (NU32)(((NU32)100)));
|
|
r_3 = (NU32)((NU32)(output) % (NU32)(((NU32)100)));
|
|
output = q_3;
|
|
pos_2 -= ((NI)2);
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, r_3);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NI32 T52_;
|
|
if (!(tz == nd)) goto LA50_;
|
|
T52_ = (NI32)0;
|
|
T52_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(r_3);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
tz += T52_;
|
|
}
|
|
LA50_: ;
|
|
nd += ((NI)2);
|
|
{
|
|
NU32 q2;
|
|
NU32 r2;
|
|
if (!((NU32)(((NU32)100)) <= (NU32)(output))) goto LA55_;
|
|
q2 = (NU32)((NU32)(output) / (NU32)(((NU32)100)));
|
|
r2 = (NU32)((NU32)(output) % (NU32)(((NU32)100)));
|
|
output = q2;
|
|
pos_2 -= ((NI)2);
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, r2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NI32 T61_;
|
|
if (!(tz == nd)) goto LA59_;
|
|
T61_ = (NI32)0;
|
|
T61_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(r2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
tz += T61_;
|
|
}
|
|
LA59_: ;
|
|
nd += ((NI)2);
|
|
}
|
|
LA55_: ;
|
|
}
|
|
LA46_: ;
|
|
{
|
|
NU32 q_4;
|
|
if (!((NU32)(((NU32)10)) <= (NU32)(output))) goto LA64_;
|
|
q_4 = output;
|
|
pos_2 -= ((NI)2);
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, q_4);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NI32 T70_;
|
|
if (!(tz == nd)) goto LA68_;
|
|
T70_ = (NI32)0;
|
|
T70_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(q_4);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
tz += T70_;
|
|
}
|
|
LA68_: ;
|
|
}
|
|
goto LA62_;
|
|
LA64_: ;
|
|
{
|
|
NU32 q_5;
|
|
q_5 = output;
|
|
pos_2 -= ((NI)1);
|
|
buf[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32)48)) + (NU32)(q_5))))));
|
|
}
|
|
LA62_: ;
|
|
result = tz;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, formatDigits__stdZprivateZdragonbox_623)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU64 digits, NI decimalExponent, NIM_BOOL forceTrailingDotZero) {
|
|
NI result;
|
|
NI pos_2;
|
|
NI numDigits;
|
|
NI decimalPoint;
|
|
NIM_BOOL useFixed;
|
|
NIM_BOOL T1_;
|
|
NI decimalDigitsPosition;
|
|
NI digitsEnd;
|
|
NI32 tz;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
pos_2 = pos;
|
|
numDigits = decimalLength__stdZprivateZdragonbox_570(digits);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
decimalPoint = (NI)(numDigits + decimalExponent);
|
|
T1_ = (NIM_BOOL)0;
|
|
T1_ = (((NI)-6) <= decimalPoint);
|
|
if (!(T1_)) goto LA2_;
|
|
T1_ = (decimalPoint <= ((NI)17));
|
|
LA2_: ;
|
|
useFixed = T1_;
|
|
{
|
|
NI i;
|
|
NI i_2;
|
|
i = (NI)0;
|
|
i_2 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(i_2 < ((NI)32))) goto LA5 ;
|
|
i = i_2;
|
|
buffer[(NI)(pos_2 + i)] = 48;
|
|
i_2 += ((NI)1);
|
|
} LA5: ;
|
|
}
|
|
}
|
|
decimalDigitsPosition = (NI)0;
|
|
{
|
|
if (!useFixed) goto LA8_;
|
|
{
|
|
if (!(decimalPoint <= ((NI)0))) goto LA12_;
|
|
decimalDigitsPosition = (NI)(((NI)2) - decimalPoint);
|
|
}
|
|
goto LA10_;
|
|
LA12_: ;
|
|
{
|
|
decimalDigitsPosition = ((NI)0);
|
|
}
|
|
LA10_: ;
|
|
}
|
|
goto LA6_;
|
|
LA8_: ;
|
|
{
|
|
decimalDigitsPosition = ((NI)1);
|
|
}
|
|
LA6_: ;
|
|
digitsEnd = (NI)(pos_2 + (NI)(decimalDigitsPosition + numDigits));
|
|
tz = printDecimalDigitsBackwards__stdZprivateZdragonbox_445(buffer, bufferLen_0, digitsEnd, digits);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
digitsEnd -= tz;
|
|
numDigits -= tz;
|
|
{
|
|
if (!useFixed) goto LA18_;
|
|
{
|
|
if (!(decimalPoint <= ((NI)0))) goto LA22_;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = 46;
|
|
pos_2 = digitsEnd;
|
|
}
|
|
goto LA20_;
|
|
LA22_: ;
|
|
{
|
|
tyArray__Wfh9bjgBQ4UqJsyISUuDSuA tmp;
|
|
if (!(decimalPoint < numDigits)) goto LA25_;
|
|
nimZeroMem((void*)tmp, sizeof(tyArray__Wfh9bjgBQ4UqJsyISUuDSuA));
|
|
{
|
|
NI i_3;
|
|
NI i_4;
|
|
i_3 = (NI)0;
|
|
i_4 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(i_4 < ((NI)16))) goto LA29 ;
|
|
i_3 = i_4;
|
|
tmp[(i_3)- 0] = buffer[(NI)((NI)(i_3 + pos_2) + decimalPoint)];
|
|
i_4 += ((NI)1);
|
|
} LA29: ;
|
|
}
|
|
}
|
|
{
|
|
NI i_5;
|
|
NI i_6;
|
|
i_5 = (NI)0;
|
|
i_6 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(i_6 < ((NI)16))) goto LA32 ;
|
|
i_5 = i_6;
|
|
buffer[(NI)((NI)((NI)(i_5 + pos_2) + decimalPoint) + ((NI)1))] = tmp[(i_5)- 0];
|
|
i_6 += ((NI)1);
|
|
} LA32: ;
|
|
}
|
|
}
|
|
buffer[(NI)(pos_2 + decimalPoint)] = 46;
|
|
pos_2 = (NI)(digitsEnd + ((NI)1));
|
|
}
|
|
goto LA20_;
|
|
LA25_: ;
|
|
{
|
|
pos_2 += decimalPoint;
|
|
{
|
|
if (!forceTrailingDotZero) goto LA36_;
|
|
buffer[pos_2] = 46;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = 48;
|
|
pos_2 += ((NI)2);
|
|
}
|
|
LA36_: ;
|
|
}
|
|
LA20_: ;
|
|
}
|
|
goto LA16_;
|
|
LA18_: ;
|
|
{
|
|
NIM_CHAR colontmpD_;
|
|
NIM_CHAR colontmpD__2;
|
|
NI colontmpD__3;
|
|
NI colontmpD__4;
|
|
NI scientificExponent;
|
|
NU32 k;
|
|
NI T49_;
|
|
colontmpD_ = (NIM_CHAR)0;
|
|
colontmpD__2 = (NIM_CHAR)0;
|
|
colontmpD__3 = (NI)0;
|
|
colontmpD__4 = (NI)0;
|
|
buffer[pos_2] = buffer[(NI)(pos_2 + ((NI)1))];
|
|
{
|
|
if (!(numDigits == ((NI)1))) goto LA41_;
|
|
pos_2 += ((NI)1);
|
|
}
|
|
goto LA39_;
|
|
LA41_: ;
|
|
{
|
|
buffer[(NI)(pos_2 + ((NI)1))] = 46;
|
|
pos_2 = digitsEnd;
|
|
}
|
|
LA39_: ;
|
|
scientificExponent = (NI)(decimalPoint - ((NI)1));
|
|
buffer[pos_2] = 101;
|
|
{
|
|
if (!(scientificExponent < ((NI)0))) goto LA46_;
|
|
colontmpD_ = 45;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = colontmpD_;
|
|
}
|
|
goto LA44_;
|
|
LA46_: ;
|
|
{
|
|
colontmpD__2 = 43;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = colontmpD__2;
|
|
}
|
|
LA44_: ;
|
|
pos_2 += ((NI)2);
|
|
T49_ = (NI)0;
|
|
{
|
|
if (!(scientificExponent < ((NI)0))) goto LA52_;
|
|
colontmpD__3 = ((NI64)-(scientificExponent));
|
|
T49_ = colontmpD__3;
|
|
}
|
|
goto LA50_;
|
|
LA52_: ;
|
|
{
|
|
colontmpD__4 = scientificExponent;
|
|
T49_ = colontmpD__4;
|
|
}
|
|
LA50_: ;
|
|
k = ((NU32) (T49_));
|
|
{
|
|
if (!((NU32)(k) < (NU32)(((NU32)10)))) goto LA57_;
|
|
buffer[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32)48)) + (NU32)(k))))));
|
|
pos_2 += ((NI)1);
|
|
}
|
|
goto LA55_;
|
|
LA57_: ;
|
|
{
|
|
if (!((NU32)(k) < (NU32)(((NU32)100)))) goto LA60_;
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buffer, bufferLen_0, pos_2, k);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos_2 += ((NI)2);
|
|
}
|
|
goto LA55_;
|
|
LA60_: ;
|
|
{
|
|
NU32 q;
|
|
NU32 r;
|
|
q = (NU32)((NU32)(k) / (NU32)(((NU32)100)));
|
|
r = (NU32)((NU32)(k) % (NU32)(((NU32)100)));
|
|
buffer[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32)48)) + (NU32)(q))))));
|
|
pos_2 += ((NI)1);
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buffer, bufferLen_0, pos_2, r);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos_2 += ((NI)2);
|
|
}
|
|
LA55_: ;
|
|
}
|
|
LA16_: ;
|
|
result = pos_2;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, toChars__stdZprivateZdragonbox_609)(NIM_CHAR* buffer, NI bufferLen_0, NF v, NIM_BOOL forceTrailingDotZero) {
|
|
NI result;
|
|
NI pos;
|
|
NU64 significand;
|
|
tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T1_;
|
|
NU64 exponent;
|
|
tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T2_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
pos = ((NI)0);
|
|
T1_ = constructDouble__stdZprivateZdragonbox_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
significand = physicalSignificand__stdZprivateZdragonbox_35(T1_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T2_ = constructDouble__stdZprivateZdragonbox_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
exponent = physicalExponent__stdZprivateZdragonbox_38(T2_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T7_;
|
|
NI T8_;
|
|
if (!!((exponent == 2047ULL))) goto LA5_;
|
|
buffer[pos] = 45;
|
|
T7_ = constructDouble__stdZprivateZdragonbox_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T8_ = (NI)0;
|
|
T8_ = signBit__stdZprivateZdragonbox_57(T7_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos += T8_;
|
|
{
|
|
NIM_BOOL T11_;
|
|
tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg dec;
|
|
T11_ = (NIM_BOOL)0;
|
|
T11_ = !((exponent == 0ULL));
|
|
if (T11_) goto LA12_;
|
|
T11_ = !((significand == 0ULL));
|
|
LA12_: ;
|
|
if (!T11_) goto LA13_;
|
|
dec = toDecimal64__stdZprivateZdragonbox_361(significand, exponent);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = formatDigits__stdZprivateZdragonbox_623(buffer, bufferLen_0, pos, dec.significand, ((NI) (dec.exponent)), forceTrailingDotZero);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA9_;
|
|
LA13_: ;
|
|
{
|
|
NI colontmpD_;
|
|
NI colontmpD__2;
|
|
NI T16_;
|
|
colontmpD_ = (NI)0;
|
|
colontmpD__2 = (NI)0;
|
|
buffer[pos] = 48;
|
|
buffer[(NI)(pos + ((NI)1))] = 46;
|
|
buffer[(NI)(pos + ((NI)2))] = 48;
|
|
buffer[(NI)(pos + ((NI)3))] = 32;
|
|
T16_ = (NI)0;
|
|
{
|
|
if (!forceTrailingDotZero) goto LA19_;
|
|
colontmpD_ = ((NI)3);
|
|
T16_ = colontmpD_;
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
colontmpD__2 = ((NI)1);
|
|
T16_ = colontmpD__2;
|
|
}
|
|
LA17_: ;
|
|
pos += T16_;
|
|
result = pos;
|
|
goto BeforeRet_;
|
|
}
|
|
LA9_: ;
|
|
}
|
|
LA5_: ;
|
|
{
|
|
tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T26_;
|
|
NI T27_;
|
|
if (!(significand == 0ULL)) goto LA24_;
|
|
buffer[pos] = 45;
|
|
T26_ = constructDouble__stdZprivateZdragonbox_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T27_ = (NI)0;
|
|
T27_ = signBit__stdZprivateZdragonbox_57(T26_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos += T27_;
|
|
buffer[pos] = 105;
|
|
buffer[(NI)(pos + ((NI)1))] = 110;
|
|
buffer[(NI)(pos + ((NI)2))] = 102;
|
|
buffer[(NI)(pos + ((NI)3))] = 32;
|
|
result = (NI)(pos + ((NI)3));
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA22_;
|
|
LA24_: ;
|
|
{
|
|
buffer[pos] = 110;
|
|
buffer[(NI)(pos + ((NI)1))] = 97;
|
|
buffer[(NI)(pos + ((NI)2))] = 110;
|
|
buffer[(NI)(pos + ((NI)3))] = 32;
|
|
result = (NI)(pos + ((NI)3));
|
|
goto BeforeRet_;
|
|
}
|
|
LA22_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferRoundtrip__stdZformatfloat_14)(NIM_CHAR* buf, NF value) {
|
|
NI result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
result = toChars__stdZprivateZdragonbox_609(buf, 65, value, NIM_TRUE);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
buf[(result)- 0] = 0;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, addCstringN__stdZformatfloat_6)(NimStringV2* result, NCSTRING buf, NI buflen) {
|
|
NI oldLen;
|
|
NI newLen;
|
|
void* T1_;
|
|
oldLen = (*result).len;
|
|
newLen = (NI)(oldLen + buflen);
|
|
setLengthStrV2((&(*result)), ((NI) (newLen)));
|
|
T1_ = (void*)0;
|
|
T1_ = memcpy(((void*) ((&(*result).p->data[oldLen]))), ((void*) (buf)), ((size_t) (buflen)));
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, addFloatRoundtrip__system_4375)(NimStringV2* result, NF x) {
|
|
tyArray__eVNFTutn6un5gcq48fQLdg buffer;
|
|
NI n;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
n = writeFloatToBufferRoundtrip__stdZformatfloat_14(buffer, x);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
addCstringN__stdZformatfloat_6(result, ((NCSTRING) ((&buffer[(((NI)0))- 0]))), n);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
static N_INLINE(void, addFloat__system_4370)(NimStringV2* result, NF x) {
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
addFloatRoundtrip__system_4375(result, x);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___system_4366)(NF x) {
|
|
NimStringV2 result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
addFloat__system_4370((&result), x);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, writeToBuffer__stdZformatfloat_61)(NIM_CHAR* buf, NCSTRING value) {
|
|
NI i;
|
|
i = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!!(((NU8)(value[i]) == (NU8)(0)))) goto LA2 ;
|
|
buf[(i)- 0] = value[i];
|
|
i += ((NI)1);
|
|
} LA2: ;
|
|
}
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferSprintf__stdZformatfloat_70)(NIM_CHAR* buf, NF value) {
|
|
NI result;
|
|
NI n;
|
|
int T1_;
|
|
NIM_BOOL hasDot;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
T1_ = (int)0;
|
|
T1_ = sprintf(((NCSTRING) (buf)), "%.16g", value);
|
|
n = ((NI) (T1_));
|
|
hasDot = NIM_FALSE;
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
colontmp_ = (NI)(n - ((NI)1));
|
|
res = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(res <= colontmp_)) goto LA4 ;
|
|
i = res;
|
|
{
|
|
if (!((NU8)(buf[(i)- 0]) == (NU8)(44))) goto LA7_;
|
|
buf[(i)- 0] = 46;
|
|
hasDot = NIM_TRUE;
|
|
}
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{
|
|
if (!(((NU8)(buf[(i)- 0])) >= ((NU8)(97)) && ((NU8)(buf[(i)- 0])) <= ((NU8)(122)) || ((NU8)(buf[(i)- 0])) >= ((NU8)(65)) && ((NU8)(buf[(i)- 0])) <= ((NU8)(90)) || ((NU8)(buf[(i)- 0])) == ((NU8)(46)))) goto LA10_;
|
|
hasDot = NIM_TRUE;
|
|
}
|
|
goto LA5_;
|
|
LA10_: ;
|
|
LA5_: ;
|
|
res += ((NI)1);
|
|
} LA4: ;
|
|
}
|
|
}
|
|
{
|
|
if (!!(hasDot)) goto LA14_;
|
|
buf[(n)- 0] = 46;
|
|
buf[((NI)(n + ((NI)1)))- 0] = 48;
|
|
buf[((NI)(n + ((NI)2)))- 0] = 0;
|
|
result = (NI)(n + ((NI)2));
|
|
}
|
|
goto LA12_;
|
|
LA14_: ;
|
|
{
|
|
result = n;
|
|
}
|
|
LA12_: ;
|
|
{
|
|
if (!(((NU8)(buf[((NI)(n - ((NI)1)))- 0])) == ((NU8)(110)) || ((NU8)(buf[((NI)(n - ((NI)1)))- 0])) == ((NU8)(78)) || ((NU8)(buf[((NI)(n - ((NI)1)))- 0])) == ((NU8)(68)) || ((NU8)(buf[((NI)(n - ((NI)1)))- 0])) == ((NU8)(100)) || ((NU8)(buf[((NI)(n - ((NI)1)))- 0])) == ((NU8)(41)))) goto LA19_;
|
|
writeToBuffer__stdZformatfloat_61(buf, "nan");
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = ((NI)3);
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
if (!((NU8)(buf[((NI)(n - ((NI)1)))- 0]) == (NU8)(70))) goto LA22_;
|
|
{
|
|
if (!((NU8)(buf[(((NI)0))- 0]) == (NU8)(45))) goto LA26_;
|
|
writeToBuffer__stdZformatfloat_61(buf, "-inf");
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = ((NI)4);
|
|
}
|
|
goto LA24_;
|
|
LA26_: ;
|
|
{
|
|
writeToBuffer__stdZformatfloat_61(buf, "inf");
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = ((NI)3);
|
|
}
|
|
LA24_: ;
|
|
}
|
|
goto LA17_;
|
|
LA22_: ;
|
|
LA17_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, addFloatSprintf__stdZformatfloat_113)(NimStringV2* result, NF x) {
|
|
tyArray__eVNFTutn6un5gcq48fQLdg buffer;
|
|
NI n;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
n = writeFloatToBufferSprintf__stdZformatfloat_70(buffer, x);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
addCstringN__stdZformatfloat_6(result, ((NCSTRING) ((&buffer[(((NI)0))- 0]))), n);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
static N_INLINE(NIM_BOOL, multipleOfPow2__stdZprivateZschubfach_132)(NU32 value, NI32 e2) {
|
|
NIM_BOOL result;
|
|
{ result = (NIM_BOOL)0;
|
|
result = ((NU32)(value & (NU32)((NU32)((NU32)((NU32)(((NU32)1)) << (NU32)(e2))) - (NU32)(((NU32)1)))) == ((NU32)0));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, floorDivPow2__stdZprivateZschubfach_60)(NI32 x, NI32 n) {
|
|
NI32 result;
|
|
{ result = (NI32)0;
|
|
result = (NI32)((NI32)(x) >> (NU32)(n));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, floorLog2Pow10__stdZprivateZschubfach_68)(NI32 e) {
|
|
NI32 result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI32)0;
|
|
result = floorDivPow2__stdZprivateZschubfach_60((NI32)(e * ((NI32)1741647)), ((NI32)19));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU64, computePow10Single__stdZprivateZschubfach_92)(NI32 k) {
|
|
NU64 result;
|
|
{ result = (NU64)0;
|
|
result = g__stdZprivateZschubfach_79[((NI32)(k - ((NI32)-31)))- 0];
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU32, lo32__stdZprivateZschubfach_113)(NU64 x) {
|
|
NU32 result;
|
|
{ result = (NU32)0;
|
|
result = ((NU32) (x));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU32, hi32__stdZprivateZschubfach_116)(NU64 x) {
|
|
NU32 result;
|
|
{ result = (NU32)0;
|
|
result = ((NU32) ((NU64)((NU64)(x) >> (NU64)(((NI)32)))));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NU32, roundToOdd__stdZprivateZschubfach_123)(NU64 g, NU32 cp) {
|
|
NU32 result;
|
|
NU64 b01;
|
|
NU32 T1_;
|
|
NU64 b11;
|
|
NU32 T2_;
|
|
NU64 hi;
|
|
NU32 T3_;
|
|
NU32 y1;
|
|
NU32 y0;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NU32)0;
|
|
T1_ = (NU32)0;
|
|
T1_ = lo32__stdZprivateZschubfach_113(g);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
b01 = (NU64)((NU64)(((NU64) (T1_))) * (NU64)(((NU64) (cp))));
|
|
T2_ = (NU32)0;
|
|
T2_ = hi32__stdZprivateZschubfach_116(g);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
b11 = (NU64)((NU64)(((NU64) (T2_))) * (NU64)(((NU64) (cp))));
|
|
T3_ = (NU32)0;
|
|
T3_ = hi32__stdZprivateZschubfach_116(b01);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
hi = (NU64)((NU64)(b11) + (NU64)(((NU64) (T3_))));
|
|
y1 = hi32__stdZprivateZschubfach_116(hi);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
y0 = lo32__stdZprivateZschubfach_113(hi);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = (NU32)(y1 | ((NU32) (((NU32)(((NU32)1)) < (NU32)(y0)))));
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg, toDecimal32__stdZprivateZschubfach_149)(NU32 ieeeSignificand, NU32 ieeeExponent) {
|
|
tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg result;
|
|
NI colontmpD_;
|
|
NI colontmpD__2;
|
|
NU32 c;
|
|
NI32 q;
|
|
NIM_BOOL isEven;
|
|
NIM_BOOL lowerBoundaryIsCloser;
|
|
NIM_BOOL T14_;
|
|
NU32 cbl;
|
|
NU32 cb;
|
|
NU32 cbr;
|
|
NI32 k;
|
|
NI T16_;
|
|
NI32 h;
|
|
NI32 T22_;
|
|
NU64 pow10;
|
|
NU32 vbl;
|
|
NU32 vb;
|
|
NU32 vbr;
|
|
NU32 lower;
|
|
NU32 upper;
|
|
NU32 s;
|
|
NIM_BOOL uInside;
|
|
NIM_BOOL wInside;
|
|
NU32 mid;
|
|
NIM_BOOL roundUp;
|
|
NIM_BOOL T35_;
|
|
NIM_BOOL T37_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
|
|
colontmpD_ = (NI)0;
|
|
colontmpD__2 = (NI)0;
|
|
c = (NU32)0;
|
|
q = (NI32)0;
|
|
{
|
|
if (!!((ieeeExponent == ((NU32)0)))) goto LA3_;
|
|
c = (NU32)(((NU32)8388608) | ieeeSignificand);
|
|
q = (NI32)(((NI32) (ieeeExponent)) - ((NI32)150));
|
|
{
|
|
NIM_BOOL T7_;
|
|
NIM_BOOL T8_;
|
|
T7_ = (NIM_BOOL)0;
|
|
T8_ = (NIM_BOOL)0;
|
|
T8_ = (((NI32)0) <= ((NI32)-(q)));
|
|
if (!(T8_)) goto LA9_;
|
|
T8_ = (((NI32)-(q)) < ((NI32)24));
|
|
LA9_: ;
|
|
T7_ = T8_;
|
|
if (!(T7_)) goto LA10_;
|
|
T7_ = multipleOfPow2__stdZprivateZschubfach_132(c, ((NI32)-(q)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
LA10_: ;
|
|
if (!T7_) goto LA11_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
|
|
result.digits = (NU32)((NU32)(c) >> (NU32)(((NI32)-(q))));
|
|
result.exponent = ((NI32)0);
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
c = ieeeSignificand;
|
|
q = ((NI32)-149);
|
|
}
|
|
LA1_: ;
|
|
isEven = ((NU32)((NU32)(c) % (NU32)(((NU32)2))) == ((NU32)0));
|
|
T14_ = (NIM_BOOL)0;
|
|
T14_ = (ieeeSignificand == ((NU32)0));
|
|
if (!(T14_)) goto LA15_;
|
|
T14_ = ((NU32)(((NU32)1)) < (NU32)(ieeeExponent));
|
|
LA15_: ;
|
|
lowerBoundaryIsCloser = T14_;
|
|
cbl = (NU32)((NU32)((NU32)((NU32)((NU32)((NU32)(((NU32)4)) * (NU32)(c))) - (NU32)(((NU32)2)))) + (NU32)(((NU32) (lowerBoundaryIsCloser))));
|
|
cb = (NU32)((NU32)(((NU32)4)) * (NU32)(c));
|
|
cbr = (NU32)((NU32)((NU32)((NU32)(((NU32)4)) * (NU32)(c))) + (NU32)(((NU32)2)));
|
|
T16_ = (NI)0;
|
|
{
|
|
if (!lowerBoundaryIsCloser) goto LA19_;
|
|
colontmpD_ = ((NI)524031);
|
|
T16_ = colontmpD_;
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
colontmpD__2 = ((NI)0);
|
|
T16_ = colontmpD__2;
|
|
}
|
|
LA17_: ;
|
|
k = floorDivPow2__stdZprivateZschubfach_60((NI32)((NI32)(q * ((NI32)1262611)) - ((NI32) (T16_))), ((NI32)22));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T22_ = (NI32)0;
|
|
T22_ = floorLog2Pow10__stdZprivateZschubfach_68(((NI32)-(k)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
h = (NI32)((NI32)(q + T22_) + ((NI32)1));
|
|
pow10 = computePow10Single__stdZprivateZschubfach_92(((NI32)-(k)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
vbl = roundToOdd__stdZprivateZschubfach_123(pow10, (NU32)((NU32)(cbl) << (NU32)(h)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
vb = roundToOdd__stdZprivateZschubfach_123(pow10, (NU32)((NU32)(cb) << (NU32)(h)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
vbr = roundToOdd__stdZprivateZschubfach_123(pow10, (NU32)((NU32)(cbr) << (NU32)(h)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
lower = (NU32)((NU32)(vbl) + (NU32)(((NU32) (!(isEven)))));
|
|
upper = (NU32)((NU32)(vbr) - (NU32)(((NU32) (!(isEven)))));
|
|
s = (NU32)((NU32)(vb) / (NU32)(((NU32)4)));
|
|
{
|
|
NU32 sp;
|
|
NIM_BOOL upInside;
|
|
NIM_BOOL wpInside;
|
|
if (!((NU32)(((NU32)10)) <= (NU32)(s))) goto LA25_;
|
|
sp = (NU32)((NU32)(s) / (NU32)(((NU32)10)));
|
|
upInside = ((NU32)(lower) <= (NU32)((NU32)((NU32)(((NU32)40)) * (NU32)(sp))));
|
|
wpInside = ((NU32)((NU32)((NU32)((NU32)((NU32)(((NU32)40)) * (NU32)(sp))) + (NU32)(((NU32)40)))) <= (NU32)(upper));
|
|
{
|
|
if (!!((upInside == wpInside))) goto LA29_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
|
|
result.digits = (NU32)((NU32)(sp) + (NU32)(((NU32) (wpInside))));
|
|
result.exponent = (NI32)(k + ((NI32)1));
|
|
goto BeforeRet_;
|
|
}
|
|
LA29_: ;
|
|
}
|
|
LA25_: ;
|
|
uInside = ((NU32)(lower) <= (NU32)((NU32)((NU32)(((NU32)4)) * (NU32)(s))));
|
|
wInside = ((NU32)((NU32)((NU32)((NU32)((NU32)(((NU32)4)) * (NU32)(s))) + (NU32)(((NU32)4)))) <= (NU32)(upper));
|
|
{
|
|
if (!!((uInside == wInside))) goto LA33_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
|
|
result.digits = (NU32)((NU32)(s) + (NU32)(((NU32) (wInside))));
|
|
result.exponent = k;
|
|
goto BeforeRet_;
|
|
}
|
|
LA33_: ;
|
|
mid = (NU32)((NU32)((NU32)((NU32)(((NU32)4)) * (NU32)(s))) + (NU32)(((NU32)2)));
|
|
T35_ = (NIM_BOOL)0;
|
|
T35_ = ((NU32)(mid) < (NU32)(vb));
|
|
if (T35_) goto LA36_;
|
|
T37_ = (NIM_BOOL)0;
|
|
T37_ = (vb == mid);
|
|
if (!(T37_)) goto LA38_;
|
|
T37_ = !(((NU32)(s & ((NU32)1)) == ((NU32)0)));
|
|
LA38_: ;
|
|
T35_ = T37_;
|
|
LA36_: ;
|
|
roundUp = T35_;
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
|
|
result.digits = (NU32)((NU32)(s) + (NU32)(((NU32) (roundUp))));
|
|
result.exponent = k;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, decimalLength__stdZprivateZschubfach_236)(NU32 v) {
|
|
NI result;
|
|
{ result = (NI)0;
|
|
{
|
|
if (!((NU64)(((NU)100000000)) <= (NU64)(((NU) (v))))) goto LA3_;
|
|
result = ((NI)9);
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
{
|
|
if (!((NU64)(((NU)10000000)) <= (NU64)(((NU) (v))))) goto LA7_;
|
|
result = ((NI)8);
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
{
|
|
if (!((NU64)(((NU)1000000)) <= (NU64)(((NU) (v))))) goto LA11_;
|
|
result = ((NI)7);
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
{
|
|
if (!((NU64)(((NU)100000)) <= (NU64)(((NU) (v))))) goto LA15_;
|
|
result = ((NI)6);
|
|
goto BeforeRet_;
|
|
}
|
|
LA15_: ;
|
|
{
|
|
if (!((NU64)(((NU)10000)) <= (NU64)(((NU) (v))))) goto LA19_;
|
|
result = ((NI)5);
|
|
goto BeforeRet_;
|
|
}
|
|
LA19_: ;
|
|
{
|
|
if (!((NU64)(((NU)1000)) <= (NU64)(((NU) (v))))) goto LA23_;
|
|
result = ((NI)4);
|
|
goto BeforeRet_;
|
|
}
|
|
LA23_: ;
|
|
{
|
|
if (!((NU64)(((NU)100)) <= (NU64)(((NU) (v))))) goto LA27_;
|
|
result = ((NI)3);
|
|
goto BeforeRet_;
|
|
}
|
|
LA27_: ;
|
|
{
|
|
if (!((NU64)(((NU)10)) <= (NU64)(((NU) (v))))) goto LA31_;
|
|
result = ((NI)2);
|
|
goto BeforeRet_;
|
|
}
|
|
LA31_: ;
|
|
result = ((NI)1);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI32, printDecimalDigitsBackwards__stdZprivateZschubfach_325)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 output) {
|
|
NI32 result;
|
|
NU32 output_2;
|
|
NI pos_2;
|
|
NI32 tz;
|
|
NI32 nd;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI32)0;
|
|
output_2 = output;
|
|
pos_2 = pos;
|
|
tz = ((NI32)0);
|
|
nd = ((NI32)0);
|
|
{
|
|
NU32 q;
|
|
NU32 r;
|
|
if (!((NU32)(((NU32)10000)) <= (NU32)(output_2))) goto LA3_;
|
|
q = (NU32)((NU32)(output_2) / (NU32)(((NU32)10000)));
|
|
r = (NU32)((NU32)(output_2) % (NU32)(((NU32)10000)));
|
|
output_2 = q;
|
|
pos_2 -= ((NI)4);
|
|
{
|
|
NU32 colontmpD_;
|
|
NU32 colontmpD__2;
|
|
NI colontmpD__3;
|
|
NI colontmpD__4;
|
|
NU32 rH;
|
|
NU32 rL;
|
|
NU32 T9_;
|
|
NI32 T15_;
|
|
NI T16_;
|
|
if (!!((r == ((NU32)0)))) goto LA7_;
|
|
colontmpD_ = (NU32)0;
|
|
colontmpD__2 = (NU32)0;
|
|
colontmpD__3 = (NI)0;
|
|
colontmpD__4 = (NI)0;
|
|
rH = (NU32)((NU32)(r) / (NU32)(((NU32)100)));
|
|
rL = (NU32)((NU32)(r) % (NU32)(((NU32)100)));
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, rH);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, (NI)(pos_2 + ((NI)2)), rL);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T9_ = (NU32)0;
|
|
{
|
|
if (!(rL == ((NU32)0))) goto LA12_;
|
|
colontmpD_ = rH;
|
|
T9_ = colontmpD_;
|
|
}
|
|
goto LA10_;
|
|
LA12_: ;
|
|
{
|
|
colontmpD__2 = rL;
|
|
T9_ = colontmpD__2;
|
|
}
|
|
LA10_: ;
|
|
T15_ = (NI32)0;
|
|
T15_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(T9_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T16_ = (NI)0;
|
|
{
|
|
if (!(rL == ((NU32)0))) goto LA19_;
|
|
colontmpD__3 = ((NI)2);
|
|
T16_ = colontmpD__3;
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
colontmpD__4 = ((NI)0);
|
|
T16_ = colontmpD__4;
|
|
}
|
|
LA17_: ;
|
|
tz = (NI32)(T15_ + ((NI32) (T16_)));
|
|
}
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{
|
|
tz = ((NI32)4);
|
|
}
|
|
LA5_: ;
|
|
nd = ((NI32)4);
|
|
}
|
|
LA3_: ;
|
|
{
|
|
NU32 q_2;
|
|
NU32 r_2;
|
|
if (!((NU32)(((NU32)100)) <= (NU32)(output_2))) goto LA25_;
|
|
q_2 = (NU32)((NU32)(output_2) / (NU32)(((NU32)100)));
|
|
r_2 = (NU32)((NU32)(output_2) % (NU32)(((NU32)100)));
|
|
output_2 = q_2;
|
|
pos_2 -= ((NI)2);
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, r_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NI32 T31_;
|
|
if (!(tz == nd)) goto LA29_;
|
|
T31_ = (NI32)0;
|
|
T31_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(r_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
tz += T31_;
|
|
}
|
|
LA29_: ;
|
|
nd += ((NI)2);
|
|
{
|
|
NU32 q2;
|
|
NU32 r2;
|
|
if (!((NU32)(((NU32)100)) <= (NU32)(output_2))) goto LA34_;
|
|
q2 = (NU32)((NU32)(output_2) / (NU32)(((NU32)100)));
|
|
r2 = (NU32)((NU32)(output_2) % (NU32)(((NU32)100)));
|
|
output_2 = q2;
|
|
pos_2 -= ((NI)2);
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, r2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NI32 T40_;
|
|
if (!(tz == nd)) goto LA38_;
|
|
T40_ = (NI32)0;
|
|
T40_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(r2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
tz += T40_;
|
|
}
|
|
LA38_: ;
|
|
nd += ((NI)2);
|
|
}
|
|
LA34_: ;
|
|
}
|
|
LA25_: ;
|
|
{
|
|
NU32 q_3;
|
|
if (!((NU32)(((NU32)10)) <= (NU32)(output_2))) goto LA43_;
|
|
q_3 = output_2;
|
|
pos_2 -= ((NI)2);
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buf, bufLen_0, pos_2, q_3);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NI32 T49_;
|
|
if (!(tz == nd)) goto LA47_;
|
|
T49_ = (NI32)0;
|
|
T49_ = trailingZeros2Digits__stdZprivateZdigitsutils_43(q_3);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
tz += T49_;
|
|
}
|
|
LA47_: ;
|
|
}
|
|
goto LA41_;
|
|
LA43_: ;
|
|
{
|
|
NU32 q_4;
|
|
q_4 = output_2;
|
|
pos_2 -= ((NI)1);
|
|
buf[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32)48)) + (NU32)(q_4))))));
|
|
}
|
|
LA41_: ;
|
|
result = tz;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, formatDigits__stdZprivateZschubfach_280)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU32 digits, NI decimalExponent, NIM_BOOL forceTrailingDotZero) {
|
|
NI result;
|
|
NI pos_2;
|
|
NI numDigits;
|
|
NI decimalPoint;
|
|
NIM_BOOL useFixed;
|
|
NIM_BOOL T1_;
|
|
NI decimalDigitsPosition;
|
|
NI digitsEnd;
|
|
NI32 tz;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
pos_2 = pos;
|
|
numDigits = decimalLength__stdZprivateZschubfach_236(digits);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
decimalPoint = (NI)(numDigits + decimalExponent);
|
|
T1_ = (NIM_BOOL)0;
|
|
T1_ = (((NI)-4) <= decimalPoint);
|
|
if (!(T1_)) goto LA2_;
|
|
T1_ = (decimalPoint <= ((NI)9));
|
|
LA2_: ;
|
|
useFixed = T1_;
|
|
{
|
|
NI i;
|
|
NI i_2;
|
|
i = (NI)0;
|
|
i_2 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(i_2 < ((NI)32))) goto LA5 ;
|
|
i = i_2;
|
|
buffer[(NI)(pos_2 + i)] = 48;
|
|
i_2 += ((NI)1);
|
|
} LA5: ;
|
|
}
|
|
}
|
|
decimalDigitsPosition = (NI)0;
|
|
{
|
|
if (!useFixed) goto LA8_;
|
|
{
|
|
if (!(decimalPoint <= ((NI)0))) goto LA12_;
|
|
decimalDigitsPosition = (NI)(((NI)2) - decimalPoint);
|
|
}
|
|
goto LA10_;
|
|
LA12_: ;
|
|
{
|
|
decimalDigitsPosition = ((NI)0);
|
|
}
|
|
LA10_: ;
|
|
}
|
|
goto LA6_;
|
|
LA8_: ;
|
|
{
|
|
decimalDigitsPosition = ((NI)1);
|
|
}
|
|
LA6_: ;
|
|
digitsEnd = (NI)((NI)(pos_2 + decimalDigitsPosition) + numDigits);
|
|
tz = printDecimalDigitsBackwards__stdZprivateZschubfach_325(buffer, bufferLen_0, digitsEnd, digits);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
digitsEnd -= tz;
|
|
numDigits -= tz;
|
|
{
|
|
if (!useFixed) goto LA18_;
|
|
{
|
|
if (!(decimalPoint <= ((NI)0))) goto LA22_;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = 46;
|
|
pos_2 = digitsEnd;
|
|
}
|
|
goto LA20_;
|
|
LA22_: ;
|
|
{
|
|
if (!(decimalPoint < numDigits)) goto LA25_;
|
|
{
|
|
NI i_3;
|
|
NI res;
|
|
i_3 = (NI)0;
|
|
res = ((NI)7);
|
|
{
|
|
while (1) {
|
|
if (!(((NI)0) <= res)) goto LA29 ;
|
|
i_3 = res;
|
|
buffer[(NI)((NI)(i_3 + decimalPoint) + ((NI)1))] = buffer[(NI)(i_3 + decimalPoint)];
|
|
res -= ((NI)1);
|
|
} LA29: ;
|
|
}
|
|
}
|
|
buffer[(NI)(pos_2 + decimalPoint)] = 46;
|
|
pos_2 = (NI)(digitsEnd + ((NI)1));
|
|
}
|
|
goto LA20_;
|
|
LA25_: ;
|
|
{
|
|
pos_2 += decimalPoint;
|
|
{
|
|
if (!forceTrailingDotZero) goto LA33_;
|
|
buffer[pos_2] = 46;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = 48;
|
|
pos_2 += ((NI)2);
|
|
}
|
|
LA33_: ;
|
|
}
|
|
LA20_: ;
|
|
}
|
|
goto LA16_;
|
|
LA18_: ;
|
|
{
|
|
NIM_CHAR colontmpD_;
|
|
NIM_CHAR colontmpD__2;
|
|
NI colontmpD__3;
|
|
NI colontmpD__4;
|
|
NI scientificExponent;
|
|
NU32 k;
|
|
NI T46_;
|
|
colontmpD_ = (NIM_CHAR)0;
|
|
colontmpD__2 = (NIM_CHAR)0;
|
|
colontmpD__3 = (NI)0;
|
|
colontmpD__4 = (NI)0;
|
|
buffer[pos_2] = buffer[(NI)(pos_2 + ((NI)1))];
|
|
{
|
|
if (!(numDigits == ((NI)1))) goto LA38_;
|
|
pos_2 += ((NI)1);
|
|
}
|
|
goto LA36_;
|
|
LA38_: ;
|
|
{
|
|
buffer[(NI)(pos_2 + ((NI)1))] = 46;
|
|
pos_2 = digitsEnd;
|
|
}
|
|
LA36_: ;
|
|
scientificExponent = (NI)(decimalPoint - ((NI)1));
|
|
buffer[pos_2] = 101;
|
|
{
|
|
if (!(scientificExponent < ((NI)0))) goto LA43_;
|
|
colontmpD_ = 45;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = colontmpD_;
|
|
}
|
|
goto LA41_;
|
|
LA43_: ;
|
|
{
|
|
colontmpD__2 = 43;
|
|
buffer[(NI)(pos_2 + ((NI)1))] = colontmpD__2;
|
|
}
|
|
LA41_: ;
|
|
pos_2 += ((NI)2);
|
|
T46_ = (NI)0;
|
|
{
|
|
if (!(scientificExponent < ((NI)0))) goto LA49_;
|
|
colontmpD__3 = ((NI64)-(scientificExponent));
|
|
T46_ = colontmpD__3;
|
|
}
|
|
goto LA47_;
|
|
LA49_: ;
|
|
{
|
|
colontmpD__4 = scientificExponent;
|
|
T46_ = colontmpD__4;
|
|
}
|
|
LA47_: ;
|
|
k = ((NU32) (T46_));
|
|
{
|
|
if (!((NU32)(k) < (NU32)(((NU32)10)))) goto LA54_;
|
|
buffer[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32)48)) + (NU32)(k))))));
|
|
pos_2 += ((NI)1);
|
|
}
|
|
goto LA52_;
|
|
LA54_: ;
|
|
{
|
|
utoa2Digits__stdZprivateZdigitsutils_27(buffer, bufferLen_0, pos_2, k);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos_2 += ((NI)2);
|
|
}
|
|
LA52_: ;
|
|
}
|
|
LA16_: ;
|
|
result = pos_2;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, float32ToChars__stdZprivateZschubfach_266)(NIM_CHAR* buffer, NI bufferLen_0, NF32 v, NIM_BOOL forceTrailingDotZero) {
|
|
NI result;
|
|
NU32 significand;
|
|
tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T1_;
|
|
NU32 exponent;
|
|
tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T2_;
|
|
NI pos;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
T1_ = constructSingle__stdZprivateZschubfach_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
significand = physicalSignificand__stdZprivateZschubfach_35(T1_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T2_ = constructSingle__stdZprivateZschubfach_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
exponent = physicalExponent__stdZprivateZschubfach_38(T2_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos = ((NI)0);
|
|
{
|
|
tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T7_;
|
|
NI T8_;
|
|
if (!!((exponent == ((NU32)255)))) goto LA5_;
|
|
buffer[pos] = 45;
|
|
T7_ = constructSingle__stdZprivateZschubfach_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T8_ = (NI)0;
|
|
T8_ = signBit__stdZprivateZschubfach_57(T7_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos += T8_;
|
|
{
|
|
NIM_BOOL T11_;
|
|
tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg dec;
|
|
T11_ = (NIM_BOOL)0;
|
|
T11_ = !((exponent == ((NU32)0)));
|
|
if (T11_) goto LA12_;
|
|
T11_ = !((significand == ((NU32)0)));
|
|
LA12_: ;
|
|
if (!T11_) goto LA13_;
|
|
dec = toDecimal32__stdZprivateZschubfach_149(significand, exponent);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = formatDigits__stdZprivateZschubfach_280(buffer, bufferLen_0, pos, dec.digits, ((NI) (dec.exponent)), forceTrailingDotZero);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA9_;
|
|
LA13_: ;
|
|
{
|
|
NI colontmpD_;
|
|
NI colontmpD__2;
|
|
NI T16_;
|
|
colontmpD_ = (NI)0;
|
|
colontmpD__2 = (NI)0;
|
|
buffer[pos] = 48;
|
|
buffer[(NI)(pos + ((NI)1))] = 46;
|
|
buffer[(NI)(pos + ((NI)2))] = 48;
|
|
buffer[(NI)(pos + ((NI)3))] = 32;
|
|
T16_ = (NI)0;
|
|
{
|
|
if (!forceTrailingDotZero) goto LA19_;
|
|
colontmpD_ = ((NI)3);
|
|
T16_ = colontmpD_;
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
colontmpD__2 = ((NI)1);
|
|
T16_ = colontmpD__2;
|
|
}
|
|
LA17_: ;
|
|
pos += T16_;
|
|
result = pos;
|
|
goto BeforeRet_;
|
|
}
|
|
LA9_: ;
|
|
}
|
|
LA5_: ;
|
|
{
|
|
tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T26_;
|
|
NI T27_;
|
|
if (!(significand == ((NU32)0))) goto LA24_;
|
|
buffer[pos] = 45;
|
|
T26_ = constructSingle__stdZprivateZschubfach_32(v);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T27_ = (NI)0;
|
|
T27_ = signBit__stdZprivateZschubfach_57(T26_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
pos += T27_;
|
|
buffer[pos] = 105;
|
|
buffer[(NI)(pos + ((NI)1))] = 110;
|
|
buffer[(NI)(pos + ((NI)2))] = 102;
|
|
buffer[(NI)(pos + ((NI)3))] = 32;
|
|
result = (NI)(pos + ((NI)3));
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA22_;
|
|
LA24_: ;
|
|
{
|
|
buffer[pos] = 110;
|
|
buffer[(NI)(pos + ((NI)1))] = 97;
|
|
buffer[(NI)(pos + ((NI)2))] = 110;
|
|
buffer[(NI)(pos + ((NI)3))] = 32;
|
|
result = (NI)(pos + ((NI)3));
|
|
goto BeforeRet_;
|
|
}
|
|
LA22_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferRoundtrip__stdZformatfloat_54)(NIM_CHAR* buf, NF32 value) {
|
|
NI result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
result = float32ToChars__stdZprivateZschubfach_266(buf, 65, value, NIM_TRUE);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
buf[(result)- 0] = 0;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, addFloatRoundtrip__cgen_18097)(NimStringV2* result, NF32 x) {
|
|
tyArray__eVNFTutn6un5gcq48fQLdg buffer;
|
|
NI n;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
n = writeFloatToBufferRoundtrip__stdZformatfloat_54(buffer, x);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
addCstringN__stdZformatfloat_6(result, ((NCSTRING) ((&buffer[(((NI)0))- 0]))), n);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|