MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / decimal64FromString

Function decimal64FromString

extern/decNumber/decimal64.c:439–454  ·  view source on GitHub ↗

------------------------------------------------------------------ */ to-number -- conversion from numeric string */ / decimal64FromString(result, string, set); */ / result is the decimal64 format number which gets the result of */ the conversion */ string is the character string which should contain a vali

Source from the content-addressed store, hash-verified

437/* If an error occurs, the result will be a valid decimal64 NaN. */
438/* ------------------------------------------------------------------ */
439decimal64 * decimal64FromString(decimal64 *result, const char *string,
440 decContext *set) {
441 decContext dc; // work
442 decNumber dn; // ..
443
444 decContextDefault(&dc, DEC_INIT_DECIMAL64); // no traps, please
445 dc.round=set->round; // use supplied rounding
446
447 decNumberFromString(&dn, string, &dc); // will round if needed
448
449 decimal64FromNumber(result, &dn, &dc);
450 if (dc.status!=0) { // something happened
451 decContextSetStatus(set, dc.status); // .. pass it on
452 }
453 return result;
454 } // decimal64FromString
455
456/* ------------------------------------------------------------------ */
457/* decimal64IsCanonical -- test whether encoding is canonical */

Callers

nothing calls this directly

Calls 4

decContextDefaultFunction · 0.85
decNumberFromStringFunction · 0.85
decimal64FromNumberFunction · 0.85
decContextSetStatusFunction · 0.85

Tested by

no test coverage detected