If float results are required for proper comparison (and I vaguely remember a similar `[[x, 0.0].max, 1.0].min` from pdf-writer), then force a float: `[[x.to_f, 0.0].max, 1.0].min`. On Fri, Apr 27, 2018 at 10:40 AM <alex / pointlessone.org> wrote: > Issue #14350 has been updated by cheba (Alexander Mankuta). > > > This change afects PrawnPDF gems (I'm a maintainer). > > From the maths point of view it is indeed insignificant, but there are > other areas where exact value matters. For example, in Prawn these values > are serialized. Integer `1` is serialized to a 1-byte string `"1"` and > Float `1.0` is serialized to 3-byte string `"1.0"`. While in the context of > PDF there's no difference between the values we don't want to change > generated documents. PDF is hard to inspect for changes because it's > essentially a binary format and a relatively complex one. Most our users > rely on binary stability of output for caching purposes and we strive to > make the output stable. > > With this change we can not provide the stability between Ruby versions. > We use it in our test suite among other things. > > ---------------------------------------- > Bug #14350: Strange behavior for Array.min in ruby 2.5.0 > https://bugs.ruby-lang.org/issues/14350#change-71681 > > * Author: artofhuman (Semyon Pupkov) > * Status: Closed > * Priority: Normal > * Assignee: > * Target version: > * ruby -v: 2.5.0 > * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN > ---------------------------------------- > 2.4.2 > > ~~~ ruby > [[1, 0.0].max, 1.0].min > > => 1 > ~~~ > > 2.5.0 > > ~~~ ruby > [[1, 0.0].max, 1.0].min > > => 1.0 > > [[1, 0.0].max, 1.0] > > => [1, 1.0] > > [1, 1.0].min > > => 1 > ~~~ > > I think it`s regression for ruby 2.5.0 > > > > -- > 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> > -- Austin Ziegler halostatue / gmail.com austin / halostatue.ca http://www.halostatue.ca/ http://twitter.com/halostatue (supressed text/html) Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>