-
Notifications
You must be signed in to change notification settings - Fork 743
Find a better way of representing complex numbers types in Rust #72
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
Comments
The |
Hello,
Otherwise, we could also provide a compatible, dumb generic if we want to limit dependencies (the arithmetic seems quite involved). then the prelude would be:
Would that make sense? I'd be interested in trying to add one option. |
I think avoid bindgen dependencies is nice, so I think I'd prefer the second option. Also, we can't rely on num_complex having the expected representation (the type needs to be So yeah, definitely the second option is preferred. If you need any help, please shout out, I'll be happy to help. Should be straight-forward (sort of what we do for union fields). |
C complex only exists for floating point types. C Complex are built in types The global variable and struct members have different path to set saw_complex.
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 The global variable and struct members have different path to set saw_complex.
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 Handle all the different way a complex can be present in BindgenContext setting saw_complex.
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 Handle all the different way a complex can be present in BindgenContext setting saw_complex.
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext setting saw_complex.
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext calling generated_bindegen_complex to indicate that __BindgenContext will need to be added.
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext calling generated_bindegen_complex to indicate that __BindgenContext will need to be added.
Use __BindegenComplex for C Complex Fix #72 C complex only exists for floating point types C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext calling generated_bindegen_complex to indicate that __BindgenContext will need to be added.
I plan to land parsing and code generation support for complex types. My initial plan is landing it as a constant array of items, but that doesn't mean we can't do better.
We'd need to add a new
TypeKind::Complex(ItemId)
, then use that to represent complex types. Then, at code generation, we can do something like what we do with unions, and conditionally prepend a prelude that might look like:With arithmetic operations on top of it.
The text was updated successfully, but these errors were encountered: