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

f32 "%" is broken on MSVC #27859

Closed
eefriedman opened this issue Aug 16, 2015 · 2 comments
Closed

f32 "%" is broken on MSVC #27859

eefriedman opened this issue Aug 16, 2015 · 2 comments

Comments

@eefriedman
Copy link
Contributor

fn main() {
  println!("{}", 1.5f32 % std::env::args().len() as f32);
}

This code doesn't link on MSVC targets. (Sorry if I messed up the testcase; I don't have a Rust install on Windows to test with.)

@Diggsey
Copy link
Contributor

Diggsey commented Aug 16, 2015

Isn't this supposed to be removed anyway? #27824
Does calling fmod directly work?

@steveklabnik
Copy link
Member

/cc @rust-lang/lang

alexcrichton added a commit to alexcrichton/rust that referenced this issue Aug 18, 2015
Currently `f32 % f32` will generate a link error on 32-bit MSVC because LLVM
will lower the operation to a call to the nonexistent function `fmodf`. Work
around in this in the backend by lowering to a call to `fmod` instead with
necessary extension/truncation between floats/doubles.

Closes rust-lang#27859
bors added a commit that referenced this issue Aug 19, 2015
Currently `f32 % f32` will generate a link error on 32-bit MSVC because LLVM
will lower the operation to a call to the nonexistent function `fmodf`. Work
around in this in the backend by lowering to a call to `fmod` instead with
necessary extension/truncation between floats/doubles.

Closes #27859
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants