-
Notifications
You must be signed in to change notification settings - Fork 13
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
Precision lost with double numbers #33
Comments
Probably need to review other places where a |
Also for the translated C++ to give the same result the
|
Hello WheretIB are you still around ? |
I'm still around. I will check your suggestions this weekend. |
Thank you for reply ! There is a reason to not using the same syntax for simple/similar constructs ? |
Would be nice if |
Playing a bit with this project I've add a few nore C++ keywords, most of then are parsed and silently ignored for now, and I can execute this dummy script:
I still need to change the parser to accept access |
With this experiment I want to see how far I can get to allow |
Sync to internal development branch of October 2022. Language improvements and changes: * Fixed precision of double number literals #33 * Default argument values defined in the prototype of a function are available after the body of a function is defined * Fixed closure of the variable defined inside 'if' condition * operator definitions in local blocks are no longer visible inside generic functions that are defined in outer scope/imported modules Library improvements: * Fixed `vector:sort` for containers of pointers * Added `strlen` and `strcpy` to `std.string` module for work with null-terminated character arrays * Fixed issues with `string` class in `std.string` module * Added string ordering operators <, <=, >, >= to `std.string` module * Fixed return value of `strcmp` in `std.string` module on some platforms * Added `is_derived_from` function #29 Code generation improvements: * Fixed rare issue when 'phi' merge instruction had different values coming from empty basic blocks * Global alloca temporaries can be removed by load-store propagation even when they are in global scope Runtime improvements: * Fixed GC skipping the last 4 byte object with pointers (possible on 32 bit targets) at the end of a memory block API changes: * Removed support for `NULLC_AUTOBINDING` feature that allowed calling external C functions by automatically finding them in the current running binary (using `dlsym`/`GetProcAddress`). This feature was disabled by default before in CMake builds, but not in Makefile/VS builds. As a replacement, `nullcSetMissingFunctionLookup` can be used to setup a callback for missing functions and do the same thing manually. Other changes: * Build time statistics tracking * Big improvements to build time of large multi-module nullc projects * Added support for additional import paths in nullcl -c/-x options * Made it easier to use translation to C++ in nullcl * Fixed missing math library link when nullcl -x is used #28 * Added C++ bindings for `std.memory` module translation to C++
I have applied your fix to the precision of double number parsing, thank you for that. I'm going to leave this issue open to address the changes to number parsing and to look into the remaining precision issues (maybe I'll just switch to Your fork looks interesting, those are some big changes. You might call it nullc++ :) |
Also I found something strange when testing with Do you want to join effort on it (nullc++) ?
|
Also when trying to accepts constructor/destructor |
When testing nullc with the tests from https://github.com/ArashPartow/exprtk there is a big difference in the total of equal expressions compared to C/C++ or other programming languages:
Output before :
Output after:
Patch to get a better double precision and also accept numbers like
.23
,-.34
, ...:Full test source
exprtk_functional_test.nc.zip
The text was updated successfully, but these errors were encountered: