Comments (3)
Ok, will try implement this.
from stl.
First look at the issues:
operator/
call ->operator/=
call ->_Div(...)
.- Division operations require IsNan/Nan. (Example for float)
template <class _Other>
_CONSTEXPR20 void _Div(const complex<_Other>& _Right) {
using _Myctraits = _Ctraits<_Ty>;
_Ty _Rightreal = static_cast<_Ty>(_Right.real());
_Ty _Rightimag = static_cast<_Ty>(_Right.imag());
if (_Myctraits::_Isnan(_Rightreal) || _Myctraits::_Isnan(_Rightimag)) { // <========
...
if (_Myctraits::_Isnan(_Wd) || _Wd == 0) {
this->_Val[_RE] = _Myctraits::_Nanv(); // <========
...
}
- Let's look at _Isnan. (Example for float)
static bool _Isnan(_Ty _Left) {
return _CSTD _FDtest(&_Left) == _NANCODE;
}
- And look at _FDtest. (Example for float)
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDtest(float*);
At first glance, I didn't notice a neat way to add a modifier constexpr
without breaking the logic of the code.
from stl.
Thanks for looking into this. We've had access to constexpr
NaN for a while (see numeric_limits
). For _Isnan
, it looks like we'll need to use constexpr bit_cast()
, after which the NaN pattern can be easily identified. So I'll add a note that this depends on #22.
from stl.
Related Issues (20)
- `<random>`: Optimize P0952R2 `generate_canonical` when R is a power of 2
- `<yvals_core.h>`: Update `_MSVC_STL_UPDATE` to July 2024
- P2968R2 Make `std::ignore` A First-Class Object HOT 1
- Meta LWG issue: 2024-06 meeting
- LWG-3944 Formatters converting sequences of `char` to sequences of `wchar_t`
- LWG-4074 `compatible-joinable-ranges` is underconstrained
- LWG-4083 `views::as_rvalue` should reject non-input ranges
- LWG-4096 `views::iota(views::iota(0))` should be rejected
- LWG-4098 `views::adjacent<0>` should reject non-forward ranges
- LWG-4105 `ranges::ends_with`'s Returns misses difference casting
- P0843R14 `<inplace_vector>`
- P2075R6 `philox_engine` HOT 1
- P2300R10 `std::execution`
- P2389R2 `dims`
- P2985R0 `is_virtual_base_of`
- P2997R1 Removing The Common Reference Requirement From The Indirectly Invocable Concepts
- P3168R2 `std::optional` Range Support
- Is std::sort allowed to use stack space in the standard? HOT 3
- `<xutility>`: Use addition and multiplication overflow check MSVC intrinsics like `_add_overflow_i8`, `_mul_overflow_i16`, and `_mul_full_overflow_i8` HOT 3
- `<execution>`: Should threadpool callback priority be influenced by parent thread priority? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stl.