原生结果series通过字节索引直传,C端使用Ryu精确回读编码和64 KiB批量写出;网页采用Float64缓存和CSV工作线程,减少结果处理与保存等待。 补充八路AME曲线核查、全流程分阶段计时、独立编码基准和复现工具,固定后续优化采用修正八路及rtol=1e-8。C写出1.1808→0.1638 s,点击到可查看8.0100→6.9756 s。 验证:最终10项编码专项、29项相关后端回归通过;8份原生结果逐位一致,16次网页结果/CSV/刷新恢复通过。前端构建及缓存/CSV专项在本轮结果处理工作中通过。环境、原始大结果与临时构建不纳入Git。
21 lines
997 B
C
21 lines
997 B
C
#ifndef NATIVE_JSON_NUMBERS_H
|
|
#define NATIVE_JSON_NUMBERS_H
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
#define NATIVE_JSON_DOUBLE_CAPACITY 32
|
|
|
|
/* Locale-independent finite binary64 token; no terminating NUL is promised.
|
|
* Returns its length, or zero for NaN/Infinity. Negative zero is -0.0 so both
|
|
* Python and JavaScript JSON readers preserve its sign. */
|
|
int native_json_format_double(char output[NATIVE_JSON_DOUBLE_CAPACITY], double value);
|
|
|
|
/* Write a number, or a complete array from values[i*stride]. Each call flushes
|
|
* its own fixed-size buffer into FILE, but does not fflush/fclose the FILE.
|
|
* Return zero on invalid input/nonfinite values/write failure. A failed array
|
|
* may have written a prefix: callers must not publish that document as valid.
|
|
* The caller owns FILE and must check its final flush/close before publishing. */
|
|
int native_json_write_number(FILE *file, double value);
|
|
int native_json_write_array(FILE *file, const double *values, size_t count, size_t stride);
|
|
#endif
|