Expected at least one digit in exponent

96 views Asked by At

I am writing a physics-based Rust project using Clippy as the analysis tool, and have the following code:

const G: f64 = 6.67430e-11;
const C: i32 = 299792458;
const PLANK_CONSTANT: f64 = 6.62607015eāˆ’34; // error

The error states that I should have at least one digit in the exponent, but as you can see there are many digits. I have tried removing the decimal place, adding spaces, but it still gives the error, even though it doesn't give the error for the variable G.

The full error if it helps:

Expected at least one digit in exponent. '(', '+', '-', ';', or '[' expected, got 'āˆ’'. Unknown start of token: \u{2212}

I feel like I am missing something stupid but I have read my code many times!

1

There are 1 answers

2
Yoric On BEST ANSWER
const G: f64 = 6.67430e-11;
const C: i32 = 299792458;
const PLANK_CONSTANT: f64 = 6.62607015e-34;

Surprise, it works :)

I've just replaced āˆ’ (a dash) with - (a minus).