[#83096] File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?}) — Nobuyoshi Nakada <nobu@...>
On 2017/10/04 8:47, normal@ruby-lang.org wrote:
5 messages
2017/10/04
[#83100] Re: File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?})
— Eric Wong <normalperson@...>
2017/10/04
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#83105] Re: File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?})
— Nobuyoshi Nakada <nobu@...>
2017/10/04
On 2017/10/04 15:55, Eric Wong wrote:
[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>
Hello,
9 messages
2017/10/04
[#83113] Re: Alias Enumerable#include? to Enumerable#includes?
— "Urabe, Shyouhei" <shyouhei@...>
2017/10/05
This has been requested countless times, then rejected each and every time.
[#83129] Re: Alias Enumerable#include? to Enumerable#includes?
— Alberto Almagro <albertoalmagro@...>
2017/10/05
Sorry I didn't found it on the core mail list's archive.
[#83138] Re: Alias Enumerable#include? to Enumerable#includes?
— "Urabe, Shyouhei" <shyouhei@...>
2017/10/06
Ruby has not been made of popular votes so far. You have to show us
[#83149] Re: Alias Enumerable#include? to Enumerable#includes?
— Eric Wong <normalperson@...>
2017/10/06
Alberto Almagro <albertoalmagro@gmail.com> wrote:
[#83200] [Ruby trunk Feature#13996] [PATCH] file.c: apply2files releases GVL — normalperson@...
Issue #13996 has been reported by normalperson (Eric Wong).
4 messages
2017/10/10
[ruby-core:83198] [Ruby trunk Feature#13693] Allow String#to_i and / or Kernel::Integer to parse e-notation
From:
mail@...
Date:
2017-10-10 12:53:51 UTC
List:
ruby-core #83198
Issue #13693 has been updated by sos4nt (Stefan Schテシテ殕er).
> We also wondered whether you have an actual use case.
I stumbled across this behavior when playing with a simple calculator which collects user input via:
```ruby
number = Integer(gets)
```
> Exponential notation is usually used to express very large numbers or very small numbers that don't fit integer.
I'd remove the _"that don't fit integer"_ part, but yes, it's a way to enter and display very large (or very small) numbers more concise. That's exactly was I was attempting: entering `1e30`, so I don't have to type `1000000000000000000000000000000`.
> Consistency is important, but we don't add something just for 'consistency's sake.
The documentation for [`Kernel#Integer`](http://ruby-doc.org/core-2.4.2/Kernel.html#method-i-Integer) explains that _"[...] strings should be strictly conformed to numeric representation"_. Shouldn't it in turn be able to parse for example `"1e30"`, given that `1e30` _is_ a valid [numeric representation](http://ruby-doc.org/core-2.4.2/doc/syntax/literals_rdoc.html#label-Numbers)?
I think it's more a matter of completeness than consistency. It seems odd that `Integer()` happily parses `'0xff'`, `'0b100110'` and `'0740'` but cannot handle `'1e30'`.
----------------------------------------
Feature #13693: Allow String#to_i and / or Kernel::Integer to parse e-notation
https://bugs.ruby-lang.org/issues/13693#change-67142
* Author: sos4nt (Stefan Schテシテ殕er)
* Status: Rejected
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
`Kernel` can properly convert e-notation strings into numeric objects:
```ruby
Float('1e+3') #=> 1000.0
Rational('1e+3') #=> (1000/1)
Complex('1e+3') #=> (1000.0+0i)
BigDecimal('1e+3') #=> 0.1e4
```
Same for `String`:
```ruby
'1e+3'.to_f #=> 1000.0
'1e+3'.to_r #=> (1000/1)
'1e+3'.to_c #=> (1000.0+0i)
'1e+3'.to_d #=> 0.1e4
```
With one exception:
```ruby
Integer('1e+3') #=> ArgumentError: invalid value for Integer(): "1e+3"
'1e+3'.to_i #=> 1
```
Ruby should be able to convert e-notation strings to integers, too.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>