Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to convert arrayfire array in Rust from f64 to i32? #340

Answered by 3togo
3togo asked this question in Q&A
Discussion options

To convert arrayfire array in C++ from f64 to i32, we could simply use as(i32). What is the equivalent method in rust version?

// Example, double precision array
af::array A_double(100, 1, f64); // f64 = double precision

// Cast to an i32 array
af::array A_single = A_double.as(i32);

You must be logged in to vote

I guess it should be
A_double.cast::();

Replies: 1 comment 1 reply

Comment options

I guess it should be
A_double.cast::();

You must be logged in to vote
1 reply
Comment options

Answer selected by 3togo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /