8000 Append .0 to unsuffixed float if it would otherwise become int token by dtolnay · Pull Request #90297 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Append .0 to unsuffixed float if it would otherwise become int token #90297

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

Merged
merged 2 commits into from
Nov 6, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test to confirm fnn_unsuffixed does not emit exponent notation
  • Loading branch information
dtolnay committed Nov 5, 2021
commit 1f9807799c5f70c3a215698ad6e8eb8a03725969
6 changes: 6 additions & 0 deletions src/test/ui/proc-macro/auxiliary/api/parse.rs
69E5
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore-tidy-linelength

use proc_macro::Literal;

pub fn test() {
Expand All @@ -12,6 +14,10 @@ fn test_display_literal() {
assert_eq!(Literal::f32_suffixed(-10.0).to_string(), "-10f32");
assert_eq!(Literal::f64_unsuffixed(-10.0).to_string(), "-10.0");
assert_eq!(Literal::f64_suffixed(-10.0).to_string(), "-10f64");
assert_eq!(
Literal::f64_unsuffixed(1e100).to_string(),
"10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0",
);
}

fn test_parse_literal() {
Expand Down
0