[#119637] Behavior of raising from rescue blocks when multiple rescue blocks exist — Rodrigo Rosenfeld Rosas via ruby-core <ruby-core@...>
Hello, I couldn't find any documentation about the subject, so I thought
3 messages
2024/10/29
[ruby-core:119479] [Ruby master Feature#20705] Should "0.E-9" be a valid float value?
From:
"kou (Kouhei Sutou) via ruby-core" <ruby-core@...>
Date:
2024-10-08 05:19:00 UTC
List:
ruby-core #119479
Issue #20705 has been updated by kou (Kouhei Sutou).
Status changed from Open to Closed
Assignee set to nobu (Nobuyoshi Nakada)
commit:d17edf3a170b733356836353508319443d12c53c
----------------------------------------
Feature #20705: Should "0.E-9" be a valid float value?
https://bugs.ruby-lang.org/issues/20705#change-110096
* Author: kou (Kouhei Sutou)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
Ruby doesn't accept "0.E-9" as a valid float value:
```console
$ ruby -e 'Float("0.E-9")'
<internal:kernel>:218:in 'Kernel#Float': invalid value for Float(): "0.E-9" (ArgumentError)
from -e:1:in '<main>'
```
But other systems accept "0.E-9" as a valid float value:
PostgreSQL:
```text
=> select 0.E-9;
?column?
-------------
0.000000000
(1 row)
```
MySQL:
```text
> select 0.E-9;
+-------+
| 0.E-9 |
+-------+
| 0 |
+-------+
1 row in set (0.00 sec)
```
Python:
```console
$ python3 -c 'print(0.E-9)'
0.0
```
Node.js:
```console
$ nodejs -e 'console.log(0.E-9)'
0
```
Should Ruby accept "0.E-9" as a valid float value?
FYI: I don't have an opinion of this. I just realized this by an issue from an user of a maintained library by me: https://github.com/apache/arrow/issues/43877
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/