mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Merge pull request #6457 from roc-lang/division-by-zero
Division by zero
This commit is contained in:
commit
7c19b42a99
90 changed files with 563 additions and 546 deletions
|
@ -1496,5 +1496,12 @@ fn number_literal_to_ast<T: std::fmt::Display>(arena: &Bump, num: T) -> Expr<'_>
|
|||
|
||||
let mut string = bumpalo::collections::String::with_capacity_in(64, arena);
|
||||
write!(string, "{num}").unwrap();
|
||||
Expr::Num(string.into_bump_str())
|
||||
|
||||
if string == "inf" {
|
||||
Expr::Num("∞")
|
||||
} else if string == "-inf" {
|
||||
Expr::Num("-∞")
|
||||
} else {
|
||||
Expr::Num(string.into_bump_str())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue