Commit Graph

41 Commits

Author SHA1 Message Date
ringabout
f22e5067c5 fixes #21847; let parseFloat behave like strtod (#21854) 2023-05-17 00:21:34 +02:00
metagn
02be212dae clean up SOME pending/xxx/issue link comments (#21826)
* clean up SOME pending/xxx/issue link comments

* great
2023-05-11 10:23:52 +02:00
ringabout
06cd15663d fixes ptr to cstring warnings[backport] (#20848)
* fix =#13790 ptr char (+friends) should not implicitly convert to cstring

* Apply suggestions from code review

* first round; compiles on windows

* nimPreviewSlimSystem

* conversion is unsafe, cast needed

* fixes more tests

* fixes asyncnet

* another try another error

* last one

* true

* one more

* why bugs didn't show at once

* add `nimPreviewCstringConversion` switch

* typo

* fixes ptr to cstring warnings[backport]

* add fixes

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
2022-11-16 10:22:51 +01:00
Timothee Cour
cc0f02d57d rename nimFpRoundtrips => nimPreviewFloatRoundtrip (#18566) 2021-07-23 14:57:47 -07:00
Timothee Cour
cf0cf32d27 make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)
* compiler/vmhooks: add getVar to allow vmops with var params
* addFloat vmops with var param
* cgen now renders float32 literals in c backend using roundtrip float to string
2021-07-20 22:13:52 +02:00
Andreas Rumpf
25efb53862 make dragonbox opt-in via -d:nimFpRoundtrips (#18504)
* make dragonbox opt-in via -d:nimFpRoundtrips

* make tests green again

* make tests green again
2021-07-16 18:29:49 +02:00
Andreas Rumpf
19263f2775 fixes #18400 (#18402) 2021-06-30 12:36:24 +02:00
Timothee Cour
c871e22da2 fix #7717 roundtrip float to string; fix parseFloat for js (#18248)
* refs #7717 roundtrip float to string
* make parseFloat more correct
* improve float tests
* improve float tests
* cleanup
2021-06-13 07:32:47 +02:00
Andreas Rumpf
daaa40973c added float32 schubfach algorithm; wip (#18155)
* added float32 schubfach algorithm; wip

* fixes #18418
2021-06-03 12:09:40 +02:00
Andreas Rumpf
63db2b19bf use dragonbox algorithm; alternative to #18008 (#18139)
* use dragonbox algorithm; alternative to #18008
* removed unsafe code
2021-06-01 22:29:53 +02:00
Timothee Cour
357729639f fix #16469 vm float constants: do not conflate -0.0 and 0.0 (#16470)
* fix #16469 vm float constants: do not conflate -0.0 and 0.0

* fix test for 32bit
2020-12-27 14:35:01 +01:00
Timothee Cour
96930b9cae targets: use cpp instead of c++ everywhere (was by far the most common) (#15961) 2020-11-14 10:08:15 +01:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* Error -> Defect for defects

The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.

With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
2020-04-28 19:56:01 +02:00
Timothee Cour
e4415422fe Revert "printing float values will have one more digit. (#13276) [backport]" (#13363)
This reverts commit b2c6db97f9.
2020-02-08 09:30:24 +01:00
Arne Döring
b2c6db97f9 printing float values will have one more digit. (#13276) [backport]
* printing float values will have one more digit. Fixes #13196
2020-02-07 17:10:25 +01:00
narimiran
c6a451c584 remove unused imports from tests 2019-11-06 14:35:45 +01:00
Leorize
73c8391fd3 azure: disable failing tests 2019-10-03 18:36:18 +02:00
Timothee Cour
4355f23ee5 fix #10305 nim cpp is now nan-correct at CT (#10310)
* fix #10305 nim cpp is now nan-correct at CT
* add example where simply `nim cpp -d:release` would exhibit nan bug
2019-01-15 14:50:28 +01:00
Araq
3b783f7e13 Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
skilchen
da178e4090 make mod on floats available in the VM (#9591)
* make `mod` on floats available in the VM
* add testcase
* removed no longer needed imports
2018-11-05 09:36:28 +01:00
cooldome
0ef93bdea4 update test 2018-04-29 23:26:21 +01:00
cooldome
0c9c1c013e Add a test 2018-04-29 22:57:05 +01:00
cooldome
2aebb8ed7e Fix for isssue in parseBiggestFloat #7060 (#7061) 2018-01-11 01:57:20 +01:00
Fabian Keller
6abdd7cbf6 Added 'lenient ops' module (#6754)
* added 'lenient ops' module

* made lenient ops inline/noSideEffect; updated copyright

* moved tests into external module

* added warning for the '==' operator

* mentioned lenientops in the standard library overview

* removed test on nimout -- too fragile

* removed `==` and moved doc link to core section
2017-11-21 13:22:27 +01:00
Araq
009fcc9f84 make more tests green 2017-11-01 00:56:03 +01:00
Fredrik Høisæther Rasch
8c94a00e02 fixes #6606 (#6610) 2017-10-27 11:34:57 +02:00
Andreas Rumpf
55cb959a68 make tests green again; closes #5861 2017-10-10 09:18:31 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Dominik Picheta
06415eb69d Fixes #5821 (float32 literal comparison issue) (#5825)
* Remove processing hints for async procs.
* Fixes #5821.
2017-05-17 15:57:06 +02:00
Araq
5b32dafff4 testament: OS specific disables 2017-01-31 22:54:58 +01:00
Araq
d17709cc46 made test green for Windows 2016-09-30 22:14:29 +02:00
Parashurama
4716034a7f fixes issue 4212 && add test for various valid zero floats. 2016-05-25 11:57:09 +02:00
Andreas Rumpf
835bd9aef2 fixes #4212 2016-05-25 01:10:31 +02:00
Parashurama
5d7d8816e5 fixes some issues with underscores in float literals. add more tests.
fixes some potential issues with underscores in float literals.
adds more checks for badly positionned underscores in float literals.
adds more test files.
2016-05-19 21:03:22 +02:00
Parashurama
f5761e23d3 fix issue 4181. add testcase. 2016-05-18 12:12:01 +02:00
Adam Strzelecki
e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00
Araq
30823c1ce3 make tests green 2014-08-31 15:15:26 +02:00
Araq
c6034277fc further adaptations 2014-08-29 09:12:12 +02:00
Reimer Behrends
8b8a21cb59 Fixed parsing of float literals.
Float literals were not parsed properly when their fractional part
exceeded 53 significant bits. This affected in particular math.PI
and math.E. Rather than reinventing the wheel, this patch reuses
C's strtod() implementation, which already does the heavy lifting
with respect to correctness, though some caution is necessary to
keep float parsing locale-independent.
2014-05-23 11:27:39 +02:00
Araq
20b5f31c03 new tester; all tests categorized 2014-01-13 02:10:03 +01:00