-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lossy json serialization/deserialization round-trip for floats #13196
Labels
Comments
krux02
added a commit
to krux02/Nim
that referenced
this issue
Jan 28, 2020
krux02
added a commit
to krux02/Nim
that referenced
this issue
Feb 5, 2020
Araq
pushed a commit
that referenced
this issue
Feb 7, 2020
* printing float values will have one more digit. Fixes #13196
This was referenced Feb 8, 2020
regression caused by PR #13276: echo 0.6 show 0.59999999999999998, unlike all other languages
#13362
Closed
timotheecour
added a commit
to timotheecour/Nim
that referenced
this issue
Feb 8, 2020
timotheecour
added a commit
to timotheecour/Nim
that referenced
this issue
Feb 8, 2020
This was referenced Feb 12, 2020
narimiran
pushed a commit
to narimiran/Nim
that referenced
this issue
Feb 19, 2020
* Add osOpen alias for the operating system specific open command * Add `--git.devel` option to the documentation remove unused import (nim-lang#12900) fix json regression D20191212T144944 (nim-lang#12902) [backport] Peer Review Feedback nim-lang#12901 (comment) Merge branch 'devel' of https://github.com/nim-lang/Nim into osopen Peer Review Feedback nim-lang#12901 (comment) Update lib/pure/browsers.nim Co-Authored-By: Dominik Picheta <[email protected]> Peer Review Feedback nim-lang#12901 (comment) allow typed/untyped in magic procs (nim-lang#12911) NaN floatFormat with clang_cl (nim-lang#12910) * clang_cl nan floatFormat * format add $nimeq for gdb (nim-lang#12909) ARC: cycle detector (nim-lang#12823) * first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish Cleanup leftovers of nim-lang#12911(nim-lang#12916) Fix single match output (nim-lang#12920) fixes nim-lang#12899 (nim-lang#12921) * fixes nim-lang#12899 * fixes regression: destroy global variables in reverse declaration order, closureleak test relies on it Implement NixOS distro check (nim-lang#12914) Better case coverage error message for alias and range enum (nim-lang#12913) fix error in assertions document (nim-lang#12925) [backport] fix cmdline bugs affecting nimBetterRun correctness (nim-lang#12933) [backport] fix nim-lang#12919 tasyncclosestall flaky: Address already in use (nim-lang#12934) system.reset is no longer magic (nim-lang#12937) It has now means setting x to default for new and old runtime alike Fix nim-lang#12785 (nim-lang#12943) * Fix nim-lang#12785 and add test * better variable name update documentation for `closureScope` and `capture` (nim-lang#12886) fixes nim-lang#12735 on osx, call dsymutil for debug builds (nim-lang#12931) * fix nim-lang#12735 osx: dsymutil needs to be called for debug builds * also write dsymutil command to extraCmds in json build file Auto-initialize deques (nim-lang#12879) case coverage error message for `char` (nim-lang#12948) lenVarargs: number of varargs elements (nim-lang#12907) docs: tiny style improvements added guidelines for evolving Nim's stdlib fixes a bug that kept sugar.collect from working with for loop macros [backport] fixes nim-lang#12826 fixes a regression a better bugfix fixes a test case fixes a silly regression fixes the distros.nim regression ported channels to ARC ported osproc.nim to ARC ported re.nim to ARC ARC: default to a shared heap with --threads:on osproc: fixes regression fixes another regression fixes nim-lang#12945 (nim-lang#12959) minor refactorings Fixes stackoverflow links in readme (nim-lang#12963) [backport] Allow customize Host header [ci skip] docfix .. < => ..< (nim-lang#12981) [backport] parsecfg: retain CRLF line breaks, fixes nim-lang#12970 (nim-lang#12971) generic stack trace overriding mechanism (nim-lang#12922) * libbacktrace support * switch to a generic stack trace overriding mechanism When "nimStackTraceOverride" is defined, once of the imported modules can register its own procedure to replace the default stack trace generation by calling `registerStackTraceOverride(myOwnProc)`. Tested with `./koch boot -d:release --debugger:native -d:nimStackTraceOverride --import:libbacktrace` for the compiler itself and `./bin/nim c -r -f --stacktrace:off --debugger:native -d:nimStackTraceOverride --import:libbacktrace foo.nim` for an external program. * make the StackTraceOverrideProc {.noinline.} Added fix for handling TaintedStrings in streams and httpclient (nim-lang#12969) * Added fix for taint mode in streams and httpclient * Removed taintMode export from system.nim Check pqntuples > 0 in getValue. Fixes nim-lang#12973 (nim-lang#12974) c_fflush() the rawWrite() buffer (nim-lang#12987) Stack traces on an unbuffered stderr get out of sync with line-buffered stdout - usually on Windows terminals or CI logs. This fixes it by calling C's fflush() on the output buffer in the procedure used for printing stack traces. fixes nim-lang#12989 Revert "fixes nim-lang#12989" This reverts commit 928c2fe. fixes nim-lang#12965 (nim-lang#12991) fixes nim-lang#12989 (nim-lang#12992) * fixes nim-lang#12989 * Revert "remove unwanted changes" This reverts commit 5018297. fixes disruptek/nimph#102 multi-level nim.cfg use (nim-lang#13001) [backport] --exception:goto switch for deterministic exception handling (nim-lang#12977) This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior. Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented. fix nim-lang#12985 {.push.} now does not apply to generic instantiations (nim-lang#12986) Sink to MemMove optimization in injectdestructors (nim-lang#13002) remove default argument for readLines (nim-lang#12807) [backport] fixes nim-lang#12978 (nim-lang#13012) Fix typo (nim-lang#13015) [backport] fixes nim-lang#12961 (nim-lang#13019) fixes nim-lang#12956 (nim-lang#13020) fix nim-lang#12988 (nim-lang#13022) fix nim-lang#12988 Fixes nim-lang#13026 (nim-lang#13028) fixes nim-lang#12964 (nim-lang#13027) fixes nim-lang#13032 VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (nim-lang#12877) * VM: allow certain hardcoded special var variables at CT * VM: allow all importc var, cast[int](ptr) * fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim * VM: == works for ptr/pointer nodes * bugfix: ==, cast now also works for pointer, not just ptr * VM supports cast PtrLikeKinds <=> PtrLikeKinds / int * improve cname handling * fixup + bug fix * VM: support cast from ref to int * address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI * defensive check against typ == nil fix enumtostr crash for enum-range (nim-lang#13035) fixes nim-lang#13013, reverts previous changes to readLines() (nim-lang#13036) [backport] * Revert "remove default argument for readLines (nim-lang#12807) [backport]" This reverts commit c949b81. reprjs: style changes fixes nim-lang#12996 Rst parser respect `:start-after:` and `:end-before:` in `include` directive (nim-lang#12972) * [FEATURE] rst parser respect :start-after: in include Rst parser now respects `:start-after:` and `:end-before:` attributes for `include` directive. * [DOC] include directive parsing proc update * [TEST] Added unit tests for include rst directive in `rst` module Allow `-o` option for `buildIndex` (nim-lang#13037) [backport] Addressing nim-lang#12771 This is also included in the docgen documentation [here](https://nim-lang.org/docs/docgen.html) but its not respected as reported in the issue. [cleanup] remove disabled (and obsolete) ttypetraits; rename ttypetraits2 => ttypetraits (nim-lang#13041) * remove disabled (and obsolete) ttypetraits; rename ttypetraits2 => ttypetraits * D20200105T085828 fix super strange bug that causes CI to fail: builds.sr.ht with: `Error: Settle timed out after 120 attempts` Continue nim-lang#13002 (nim-lang#13021) testament/important_packages dont run hts (nim-lang#13052) Modify the test command for nimly (nimble-package) (nim-lang#13053) clean up deprecated stuff and unused imports in tests (nim-lang#13059) --styleCheck:hint now works (nim-lang#13055) [easy] --hint:link:on now shows link cmd instead of nothing (nim-lang#13056) * --hint:link:on now shows link cmd instead of nothing * update doc for --listCmd add pqserverVersion,pqconnectionNeedsPassword,pqconnectionUsedPassword (nim-lang#13060) basename supports pragmaexpr (nim-lang#13045) * basename supports pragmaexpr * update changelog distinctBase type trait for distinct types (nim-lang#13031) make SuccessX show project file + output file (nim-lang#13043) * make SuccessX show project file + output file * address comments * fix test and add `result.err = reNimcCrash` otherwise hard to see where reNimcCrash used * address comments move entries from the wrong changelog file [ci skip] fix crash due to errant symbols in nim.cfg (nim-lang#13073) [backport] Deleted misplaced separator (nim-lang#13085) [backport] Misplaced separator, which was constantly breaking compilation on Haiku OS, was deleted. take the one good idea from --os:standalone and enable it via -d:StandaloneHeapSize (nim-lang#13077) remove all remaining warnings when build nim (with -d:nimHasLibFFI) (nim-lang#13084) * cleanup deprecations in evalffi + elsewhere * remove dead code getOrdValue64 Use '__noinline' instead of 'noinline' for N_NOINLINE gcc attribute, this prevents clashes with systems where 'noinline' might be already defined (nim-lang#13089) Fix error check code in osproc (nim-lang#13090) [backport] fixes nim-lang#13072; no test case because it will be added later with more exception handling related bugfixes fixes nim-lang#13070 typetraits: fixes nim-lang#6454; genericParams; added lenTuple; added tuple type get (nim-lang#13064) [backport] system/io.nim fix wrong documentation comment [ci skip] fixes an asyncftpclient bug; refs nim-lang#13096 [backport] System cleanup, part 1 (nim-lang#13069) * system.nim: mark what every .pop does * system.nim: un-nest when statements [backport] fix nim-lang#12813, fix nim-lang#13079 (nim-lang#13099) Correctly remove a key from CountTable when it is set to zero. more arc features (nim-lang#13098) * config update * ARC now supports 'repr' and 'new' with finalizers is supported Remove some unused/disabled OpenSSL functions (nim-lang#13106) Add link to posix_utils.html in posix.nim (nim-lang#13111) VM FFI: write(stderr, msg) and fprintf(cstderr, msg) now work at CT (nim-lang#13083) fix the ftp store function read the local file bug (nim-lang#13108) [backport] * Update asyncftpclient.nim When use newStringOfCap function not have assign memory for the string data,so if use this address the fault is rasise. * complelete the bugfix fix rtti sizeof for varargs in global scope (nim-lang#13125) [backport] fixes nim-lang#13122 (nim-lang#13126) * fixes nim-lang#13122 * moved tests to where they belong fixes nim-lang#13112 (nim-lang#13127) * improve line error information * fixes nim-lang#13112 Expose more openSSL methods. (nim-lang#13131) fixes nim-lang#13100 nim doc now treats `export localSymbol` correctly (nim-lang#13123) [backport] * fix nim-lang#13100 nim doc now treats `export localSymbol` correctly * use owner instead fixes nim-lang#13119 (nim-lang#13128) * fixes nim-lang#13119 * fixes a regression fixes nim-lang#13105 (nim-lang#13138) fixes nim-lang#10665 (nim-lang#13141) [backport] pass platform argument only if vccexe is used (nim-lang#13078) * pass platform only if vccexe is used * fixes nim-lang#12297 fixes nim-lang#13104 [backport] (nim-lang#13142) fixes nim-lang#9674 [backport] (nim-lang#13143) Fix typo in doc/destructors.rst (nim-lang#13148) Added 'ansic' os support for minimal (embedded) targets (nim-lang#13088) * os:any implementation * os:asny: omit flock/funlock calls in echoBinSafe * Disabled default "unhandled expection" reporting for `--os:any` to reduce code size. Added unhandledExceptionHook instead which can be used to get a notification from Nim and handle it from the application. System cleanup, part 2 (nim-lang#13155) * create basic_types, arithmetics, exceptions, comparisons * create setops.nim * create memalloc.nim * create gc_interface.nim * create iterators_1.nim export normalizePathEnd (nim-lang#13152) successX now correctly shows html output for `nim doc`, `nim jsondoc`; fix nim-lang#13121 (nim-lang#13116) * successX now correctly shows html output for nim doc * fixes nim-lang#13121 * fixup hintSuccessX to be less weird ARC: misc bugfixes (nim-lang#13156) * fixes nim-lang#13102 * closes nim-lang#13149 * ARC: fixes a move optimizer bug (there are more left regarding array and tuple indexing) * proper fix; fixes nim-lang#12957 * fixes yet another case object '=' code generation problem CI fix timeout error (nim-lang#13134) Remove obsolete code from osalloc (nim-lang#13158) style fix: change 'JS' to 'js' to make it consistent (nim-lang#13168) Working towards arc codegen (nim-lang#13153) fixes nim-lang#13029 fixes nim-lang#12998 nim doc regression (nim-lang#13117) fix tsizeof3 for aarch64 (nim-lang#13169) Cleanup DFA (nim-lang#13173) Fix docs (nim-lang#13176) fixes nim-lang#13095 (nim-lang#13181) * fixes nim-lang#13095 * fix typo make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (nim-lang#13170) ARC works for async on Windows (nim-lang#13179) make sink operator optional (nim-lang#13068) * make sink operator optional * bug fix, add changelog entry * Trigger build * fix one regression * fix test * Trigger build * fix typos Fix docs for subdirs too (nim-lang#13180) * Fix doc subdirs * Extract to helper proc, and fix on windows followup on nim-lang#10435 : should be diff, not show (nim-lang#13162) fixes nim-lang#13157 refs nim-lang#13054 correctly handle {.exportc,dynlib.} and {.exportcpp,dynlib.} (nim-lang#13136) * refs nim-lang#13054 correctly handle {.exportc,dynlib.} and {.exportcpp,dynlib.} * put back NIM_EXTERNC for N_LIB_EXPORT; causes issues with compilerproc fixes nim-lang#13144 (nim-lang#13145) * fixup: genscript now does not copy nimbase.h but uses -I$nim/lib times: toUnixFloat, fromUnixFloat (nim-lang#13044) maybe: allows optional chaining of field access and indexing when LHS i snil (nim-lang#13023) * maybe: allows optional chaining * fix tools/kochdocs.nim * improve semantics to distinguish valid from invalid values * for now, wrapnil, isValid, unwrap are not exported fix docs + API for fieldPairs, fields (nim-lang#13189) more on arc codegen (nim-lang#13178) * arc codegen for union type * add more tests * fix offsetof * fix tsizeof test * fix style Add link to packaging.html (nim-lang#13194) Fixes nim-lang#13186 (nim-lang#13188) fixes nim-lang#13195 revert last commit Merge branch 'devel' of https://github.com/nim-lang/Nim into devel Revert "fixes nim-lang#13195" This reverts commit cd7904f. fixes nim-lang#13110 (nim-lang#13197) fixes nim-lang#13195 (nim-lang#13198) * fixes nim-lang#13195 * extra fix * fix typo compiler/ccgtypes: hide exportc proc unless it has dynlib (nim-lang#13199) This hides most of stdlib's internal functions from resulting binaries/libraries, where they aren't needed on *nix. Static libraries are not affected by this change (visibility doesn't apply to them). fix range[enum] type conversion (nim-lang#13204) [backport] Idxmin & idxmax, continuation (nim-lang#13208) * Add idxmin() which returns the index of the minimum value * Add idxmax() which returns the index of the maximum value * Add tests for idxmin() * Add tests for idxmax() * Remove initialization of result = 0 * Adds overloading for arrays (no enums indexed arrays yet) * Add support for enum index arrays * Fix tests with enum * Fix tests for idxmax * Change names of the procedures to minIndex and maxIndex * address Araq's comments: - remove 'array' versions - add .since pragma - return 'int' instead of 'Natural' - add changelog entry Co-authored-by: Federico A. Corazza <[email protected]> fix nim-lang#13211 relativePath("foo", ".") (nim-lang#13213) fixes a critical times.nim bug reported on IRC [backport] (nim-lang#13216) httpclient, maxredirects to Natural, newHttpClient/newAsyncHttpClient add headers argument instead of hardcoded empty (nim-lang#13207) added note to re constructor regarding performance (nim-lang#13224) Since I was new to regex I did not know that there is a compilation going on with ``re"[abc]"`` constructor and so I followed the other examples in the docs blindly, that is I just put the constructor directly in the arguments of match, find, etc., which was inside a loop and then wondered why my performance was so bad. Of course putting it outside the loop made it vastly more performant. People like me would benefit from the small note I added I would think :) [backport] Documentation Fix nim-lang#12251 (nim-lang#13226) [ci skip] [backport] times/getClockStr(): fix mistake in doc (nim-lang#13229) [ci skip] new os.isRelativeTo (nim-lang#13212) [backport] Fix typo and improve in code-block of 'lib/pure/parseutils.nim' (nim-lang#13231) [ci skip] [backport] fix nim-lang#11440, add docs to isNil for seq types needing nilseq (nim-lang#13234) [ci skip] VM: allow overriding MaxLoopIterations without rebuilding nim (nim-lang#13233) kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes (nim-lang#13221) * kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes * fixup after nim-lang#13212 isRelativeTo got merged fix lots of bugs with parentDir, refs nim-lang#8734 (nim-lang#13236) Unexport even more symbols (nim-lang#13214) * system/gc: don't export markStackAndRegisters * compiler/cgen: unexport internal symbols As these functions are Nim-specific walkaround against C's optimization schemes, they don't serve any purpose being exported. * compiler/cgen: don't export global var unless marked * compiler/ccgthreadvars: don't export threadvar unless marked * tests/dll/visibility: also check for exports This ensure that these changes don't break manual exports. * compiler/cgen: hide all variables created for constants * compiler/ccgtypes: don't export RTTI variables * compiler/ccgexprs: make all complex const static * nimbase.h: fix export for windows * compiler/cgen, ccgthreadvars: export variables correctly For C/C++ variables, `extern` means that the variable is defined in an another unit. Added a new N_LIB_EXPORT_VAR to correctly export variables. Removed lib/system/allocators.nim. seqs_v2 and strs_v2 now uses allocShared0. (nim-lang#13190) * Cleanup, remove lib/system/allocators.nim. seqs_v2 and strs_v2 now use allocShared0 by default. * Fixed -d:useMalloc allocShared / reallocShared / deallocShared. These now use the alloc/dealloc/realloc implementation that also takes care of zeroing memory at realloc. * Removed debug printfs * Removed unpairedEnvAllocs() from tests/destructor/tnewruntime_misc * More mmdisp cleanups. The shared allocators do not need to zero memory or throw since the regular ones already do that * Introduced realloc0 and reallocShared0, these procs are now used by strs_v2 and seqs_v2. This also allowed the -d:useMalloc allocator to drop the extra header with allocation length. * Moved strs_v2/seqs_v2 'allocated' flag into 'cap' field * Added 'getAllocStats()' to get low level alloc/dealloc counters. Enable with -d:allocStats * *allocShared implementations for boehm and go allocators now depend on the proper *allocImpl procs [backport] documentation: Add channels examples (nim-lang#13202) [ci skip] [backport] Make all parseutils examples auto-checking (nim-lang#13238) - Also fix one example's output (ikString -> ikStr, ikVar instead of ikExpr) Updated 'nim for embedded systems' section to use --os:any and --gc:arc (nim-lang#13237) * Updated 'nim for embedded systems' section to use --os:any and --gc:arc * Added section about size optimization to embedded systems Remove name attribute from docutils.nimble (nim-lang#13239) Fixes asyncftpclient multiline reading, fixes nim-lang#4684 (nim-lang#13242) Previously, the 4th character of `result` was checked for `'-'` every time, instead of each new line. Also made it work for taint mode. Fix typo for literal `[` (nim-lang#13243) The literal value for the `tkBracketLe` token was incorrectly set to `]` rather than `[`. I've had a quick glance at the code and it doesn't look like this change will affect anything at all, but I haven't tested yet - let's see if the CI explodes... Add "origin" to window.location (nim-lang#13251) Add "origin" to window location: https://www.w3schools.com/jsref/prop_loc_origin.asp nim dump: add libpath (nim-lang#13249) contributing docs: symbols need package prefix; changed allocStats to nimAllocStats (nim-lang#13247) testament/azure: major rewrite (nim-lang#13246) This commit features a major rewrite of Azure Pipelines integration, turning the spaghetti it originally was into something maintainable. Key changes: - No longer requires a ton of hooks into testament. - Results are now cached then bulk-uploaded to prevent throttling from Azure Pipelines, avoiding costly timeouts. - A low timeout is also employed to avoid inflated test time. - The integration is now documented. Cleaned up mmdisp.nim, moved implementations into lib/system/mm/ (nim-lang#13254) make goto based exceptions available for 'nim cpp' (nim-lang#13244) * make goto based exceptions available for 'nim cpp' * optimize seq.add to be comparable to C++'s emplace_back ARC: remove unnecessary code ARC: optimize complete object constructors to use nimNewObjUninit make nre compile with --gc:arc Rename isNilOrWhitespace to isEmptyOrWhitespace and make it use allCharsInSet (nim-lang#13258) * Rename isNilOrWhitespace to isEmptyOrWhitespace * Make isEmptyOrWhitespace use allCharsInSet(Whitespace) Clearer final objects error; fixes nim-lang#13256 (nim-lang#13257) scrollTop must be settable (nim-lang#13263) * scrollTop must be assignable Make scrollTop settable * add missing export fixes nim-lang#13219 (nim-lang#13272) fixes nim-lang#13281 (nim-lang#13282) * fixes #nim-lang#13281 * add comment to test unittest add resetOutputFormatters proc (nim-lang#13267) * add resetOutputFormatters * remove space * resolve comments TlSF Alloctor: use less memory for --gc:arc (nim-lang#13280) Tiny since cleanup (nim-lang#13286) nimv2 widestring indexing (nim-lang#13279) Repr v2 progress (nim-lang#13268) * progress on repr_v2 * repr progress * add ref objects with distrinct * fix failing tests refactor htmldocs; gitignore it removed unused import fix stdout(etc) for emscripten csize => csize_t for sysctl Thread attributes should be destroyed using the pthread_attr_destroy() (nim-lang#13293) On some OSes (such as FreeBSD or Solaris), pthread_attr_init allocate memory. So it is necessary to deallocate that memory by using pthread_attr_destroy. fix critical bug discovered by nim-lang#11591 (nim-lang#13290) [backport] miscellaneous bug fixes (nim-lang#13291) * fix for emscripten etc * add testcase for nim-lang#13290 * replace deprecated isNilOrWhitespace CT FFI: fix for windows; fix case transition; error msg shows more useful context (nim-lang#13292) * evalffi: fix case transition * evalffi: fix for windows * evallffi: `cannot import` errmsg now also shows which library it tried to import symbol from refs nim-lang#8391 std/os now shows runtime context for raiseOSError exceptions (nim-lang#13294) * refs nim-lang#8391: fix errmsg for setCurrentDir * raiseOSError calls for copyFile * refs nim-lang#8391 std/os now shows runtime context for raiseOSError exceptions build_all.sh: building csources 5X faster thanks to make -j (nim-lang#13300) * build_all.sh: building csources 5X faster thanks to make -j * fix for freebsd * use OS-dependent formula to get number of logical cores * make is an optional dependency Fix capture for object types (nim-lang#13315) * Fix capture for object|tuple|... types * Add test case Quote nim executable before executing. (nim-lang#13316) [backport] In case nim executable is located in PATH containing spaces. fixes nim-lang#13311 ReSync with devel Make build_all.sh more portable and a bit simpler (nim-lang#13308) koch: enable checks in the compiler when running CI (nim-lang#13323) fix nim-lang#13132 tnetdial (nim-lang#13318) enable testing -d:nimHasLibFFI mode (nim-lang#13091) Fix nim-lang#10717, fix nim-lang#13284 (nim-lang#13307) Fixed codegen for constant cstring with --gc:arc (nim-lang#13326) * Fixed codegen for constant cstring with --gc:arc, fixes nim-lang#13321 * Added test for nim-lang#13321 Option to allow the request body to be processed outside the asynchttpserver library. (nim-lang#13147) Allow the request body to be processed outside the asynchttpserver library to break big files into chunks of data. This change does not break anything. build_all.sh update (nim-lang#13320) * Don't overload the system, don't crash when you can't determine the CPU count and don't rely on bash * Extract to variable * Limit number of spawned jobs for systems with weak IO * Use proper arithmetic braces contributing.rst: Add a special rule for 'outplace'-like features [backport] -d:danger should imply -d:release (nim-lang#13336) nim secret: support linenoise when available (nim-lang#13328) fix nim-lang#13150 `nim doc --project` now works reliably (nim-lang#13223) * fix nim-lang#13150 `nim doc --project` works with duplicate names and with imports below main project file * add to help; fixup after nim-lang#13212 isRelativeTo got merged * fix test tests/compilerapi/tcompilerapi.nim * remove nimblePkg field; compute on the fly instead * kochdocs: compiler docs now under compiler/ * --docRoot now has smart default: best among @pkg, @path make monotimes have zero overhead if you don't use it (nim-lang#13338) [backport] fix nim-lang#13349 regression: isNamedTuple now works with generic tuples (nim-lang#13350) fixes nim-lang#13269 (nim-lang#13344) adding sqlite3 backup functions (nim-lang#13346) * adding sqlite3 backup functions * changing sleep to sqlite3_sleep to prevent clashes Added a basic example how to handle a Post request. (nim-lang#13339) * Added a basic example how to handle a Post request. They were also made minor cosmetic changes. * Minor fixes suggested by Yardanico * Fixed a wrong value in chunkSize constant. * Re-added the request.body for compatibility! replace old problematic isNamedTuple implementation by TypeTrait isNamedTuple in dollars.nim (nim-lang#13347) * replace old problematic isNamedTuple implementation by TypeTrait isNamedTuple * fix for bootstrap fix nim-lang#13182: `proc fun(a: varargs[Foo, conv])` now can be overloaded (nim-lang#13345) [backport] miscellaneous bug fixes (part 3) (nim-lang#13304) * fix deprecation; fix indentation * git clone: use -q * fix Warning: pragma before generic parameter list is deprecated; fix typo * bugfix: sysTypeFromName("float64") was never cached testament: introduce 'matrix' for testing multiple options (nim-lang#13343) printing float values will have one more digit. (nim-lang#13276) [backport] * printing float values will have one more digit. Fixes nim-lang#13196 [backport] fix nim-lang#13352 [backport] remove 'CountTable.mget' (nim-lang#13355) It didn't work, and it was an oversight to be included in v1.0. fix nim-lang#6736: templates in unittest now show actual value (nim-lang#13354) Revert "printing float values will have one more digit. (nim-lang#13276) [backport]" (nim-lang#13363) This reverts commit b2c6db9. Add sideEffect pragma to importC procs in posix, winlean and time module (nim-lang#13370) * Add sideEffect pragma to procs in winlean * Add sideEffect pragma to procs in posix * Add test for nim-lang#13306 * Add sideEffect pragma to procs in times * Fixes nim-lang#13306 fixes nim-lang#3339 by documenting the limitations of case-statement (nim-lang#13366) fixes nim-lang#13314 (nim-lang#13372) testament: this now works: "testament r /abspath/to/test.nim" (nim-lang#13358) fix `is` with generic types; fix `genericHead(Foo[T])` (nim-lang#13303) * fix nim-lang#9855, fix nim-lang#9855, fix genericHead * render TTypeKind via toHumanStr fix nim-lang#13255 (nim-lang#13275) [backport] remove outplace version of 'merge' for CountTables (nim-lang#13377) * remove outplace version of 'merge' for CountTables * remove 'merge' tests fix nim-lang#13374 `nim c -r -` now generates $nimcache/stdinfile (nim-lang#13380) [backport] fix nim-lang#9634 don't crash on execCmdEx/readLine when inside gdb/lldb (nim-lang#13232) * fix nim-lang#9634 debugging a program using execCmdEx now works * only apply EINTR to c_gets for now This reverts commit c0f5305. lib.rst: add a link for jsconsole [backport] (nim-lang#13383) Make vccexe parse response files (nim-lang#13329) expectLen now shows the length that we got (nim-lang#13387) fix several bugs with `repr` (nim-lang#13386) fixes nim-lang#13378 [backport] (nim-lang#13392) remove dead code test_nimhcr_integration.(bat,sh) (nim-lang#13388) * enable test for osx: import tests/dll/nimhcr_integration * re-disable osx test fix linenoise regression (nim-lang#13395) * fix nightlies linenoise regression * fix other installers Revert "remove dead code test_nimhcr_integration.(bat,sh) (nim-lang#13388)" (nim-lang#13396) This reverts commit 90491ea. fixes nim-lang#13368 (nim-lang#13397) fix bug in int128 (nim-lang#13403) isolate the build process from external config files (nim-lang#13411) add ggplotnim to important_packages (nim-lang#13206) Fix to asynchttpserver form data/body broken with nim-lang#13147 (nim-lang#13394) * Fix to asynchttpserver form data/body broken with nim-lang#13147 * New implementation that use a interator instance of future streams * asynchttpserver now can handle chunks of data. Merge branch 'devel' of https://github.com/nim-lang/Nim into osopen Squash Commits; Peer review feedbacks nim-lang#12901 (comment) (cherry picked from commit ba25f84)
ghost
added
the
Standard Library
label
Jul 26, 2020
Any updates or plans to fix this issue ? |
timotheecour
added a commit
to timotheecour/Nim
that referenced
this issue
Jun 21, 2021
Araq
pushed a commit
that referenced
this issue
Jun 21, 2021
PMunch
pushed a commit
to PMunch/Nim
that referenced
this issue
Mar 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A json serialization + deserialization round-trip does not give back the original value for floats.
Example
(EDIT(timotheecour): see another example in #15397 (comment))
Current Output
Expected Output
No assertion error at least.
Possible Solution
This is basically a consequence that
parseFloat
and$
are not supposed be lossless (see #7717), but the json module builds on these.I made a quick check with NimYaml and it suffers from exactly the same problem.
It is a natural expectation to rely on
$
to produce an exact string representation. In my opinion the easiest solution would be to improve$
for floats. Perhaps it would make sense to implement Ryū: fast float-to-string conversion in the Nim standard library to solve the problem for good. A reference implementation is available in C and other languages. This would probably give float-to-string conversion a nice performance boost as well.The text was updated successfully, but these errors were encountered: