Skip to content
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

Dynamic::Var silently loses precision on int->float conversion #4423

Closed
aleks-f opened this issue Jan 29, 2024 · 2 comments
Closed

Dynamic::Var silently loses precision on int->float conversion #4423

aleks-f opened this issue Jan 29, 2024 · 2 comments

Comments

@aleks-f
Copy link
Member

aleks-f commented Jan 29, 2024

Description
As stated - on integral to floating point conversion, loss of precision is suppressed and ignored.

To Reproduce
Assign an int value occupying more than 23 bits (on most platforms) to a float.

Expected behavior
Precision loss should be allowed (as is in the language type system). However, it should be possible to enforce strict no-precision-loss policy for integral to floating point conversions.

@aleks-f aleks-f added this to the Release 1.14.0 milestone Jan 29, 2024
@aleks-f aleks-f self-assigned this Jan 29, 2024
@aleks-f aleks-f added this to 1.14 Jan 29, 2024
@aleks-f aleks-f changed the title Dynamic:Var silently loses precision on int->float conversion Dynamic::Var silently loses precision on int->float conversion Jan 29, 2024
@aleks-f aleks-f moved this to In Progress in 1.14 Jan 29, 2024
@andrewauclair
Copy link
Contributor

Should Poco consider migrating to std::any now that C++17 is supported?

@aleks-f
Copy link
Member Author

aleks-f commented Jan 29, 2024

Should Poco consider migrating to std::any now that C++17 is supported?

Poco::Any and std::any originate from the same source - Kevlin Henney's boost::any. I have no cycles to replace it, and I'm not sure it is worth the effort, either.

aleks-f added a commit that referenced this issue Jan 31, 2024
* feat(format): Add string_view format type spec #4409

* chore(Types): add demangle

* fix(Data): Oracle failing ODBC tests #4368

* fix some CQL and fuzz warnings; add Var::typeName()

* fix(build): -std=c++17 and c11

* fix windows build

* fix(Foundation): test apps vs projects c++17

* chore(build): remove uneeded compiler flag

* fix(VarHolder): number of digits range check for int->float conversion (reported by CIFuzz)

* fix(test): CIFuzz

* fix(CIFuzz): another attempt

* fix(progen): add LanguageStandard (stdcpp17, stdc11); regenerate vs170 projects

* fix(CiFuzz): add int->float precision loss barrier; fix erroneous number of digits logic

* enh(Var): silent loss of precision on int->float conversion #4423

* enh(Var): silent loss of precision on int->float conversion #4423

* chore(build): remove old build files

* chore: fix missing parens warning

* enh(Thread_POSIX): prevent double-joining; add error description to exceptions

* fix(Data): unresolved Column<long> linkage in test

* fix(demangle): determine type name from template parameter; add eror diagnostic for demangling failures

* chore(buildwin): remove old vs versions from build and progen scripts; update documentation

* chore(buildwin): remove leftover closing curly
@aleks-f aleks-f added the fixed label Feb 1, 2024
@aleks-f aleks-f moved this from In Progress to Done in 1.14 Feb 4, 2024
@matejk matejk closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants