Project

General

Profile

Actions

Bug #21831

closed

Prism doesn't count underscores in the fraction part of rational float

Bug #21831: Prism doesn't count underscores in the fraction part of rational float

Added by nobu (Nobuyoshi Nakada) about 9 hours ago. Updated about 8 hours ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:124474]

Description

Good.

$ ruby3.3 -e 'p 0.1_2r.to_f'
0.12

$ ruby3.4 --parser=parse.y -e 'p 0.1_2r.to_f'
0.12

Wrong.

$ ruby3.4 -e 'p 0.1_2r.to_f'
0.012

Updated by nobu (Nobuyoshi Nakada) about 8 hours ago Actions #1

  • Status changed from Open to Closed

Applied in changeset git|8baaece6d9a64e8cc51d8d0c9839546e3d039eee.


[ruby/prism] Bug #21831 Fix denominator of rational float literal

Denominators can contain underscores in fraction part as well as other
numeric literals.

https://github.com/ruby/prism/commit/e247cb58c7

Actions

Also available in: PDF Atom