Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105049 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72651 invoked from network); 3 Apr 2019 19:22:46 -0000 Received: from unknown (HELO mail-qt1-f171.google.com) (209.85.160.171) by pb1.pair.com with SMTP; 3 Apr 2019 19:22:46 -0000 Received: by mail-qt1-f171.google.com with SMTP id x12so20232951qts.7 for ; Wed, 03 Apr 2019 09:18:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yf5AHGj85p3Zcn36aGeXQHhwHxnZ6DcQNJ1weOm3SDY=; b=KLh6nnAYxx6ctRk5z+Ha79exEJyipZBBIWiRdJdJdsN2ojE3Pr05bGnXC+LhPWi0Ja j1KM6Sho7wqm5JNRVYG55aoQ8fdub82c6CaS361+d8YlNrpstEPzA0PDZsM7XKB8o6QB /LY0zZbhIPRASBIi2+A0q8sPohfK9UGZj/390+106aGGewzrSX4kkZ93CnRM++nkqijw zudb6na+1ZuIm+tBIL9ND6+CwPbEolU0Ev9ijStRB2GxGQttXNusm9FZQrgY9C2KZ+vp maAFa/qKGnvQj1KMAXO/ndLs13Octdqj7IcJ6mIopMg40abWNnIUyDJKLL3zjp3Us43Y 8mSQ== X-Gm-Message-State: APjAAAX9N0vY0o6kzBnNSWz12P0wg0ZimLzHosA/6iiwCueVR7b+i4mw wHWE6k/75LQq768HzbySHiMwYEMVYe6NQtZ3G4gA6WKzqp8= X-Google-Smtp-Source: APXvYqwzjvlvod+T6tFG2mM1+73PmiunEJIOKYNohdkIT0H7aJ1wweA/Nso+NCI0WJ5kTrxrvQzGQ64bZVw0uWEsQss= X-Received: by 2002:a0c:8693:: with SMTP id 19mr331164qvf.73.1554308292329; Wed, 03 Apr 2019 09:18:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 3 Apr 2019 11:17:59 -0500 Message-ID: To: Benjamin Morel Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000a2e4c30585a299f7" Subject: Re: [PHP-DEV] PHP_FLOAT_MIN is positive From: pollita@php.net (Sara Golemon) --000000000000a2e4c30585a299f7 Content-Type: text/plain; charset="UTF-8" On Wed, Apr 3, 2019 at 4:52 AM Benjamin Morel wrote: > I just used PHP_FLOAT_MIN for the first time, and was surprised that it is > the smallest **positive** number representable. Is this expected? > > This is unlike PHP_INT_MIN, which is the absolute smallest representable > integer, and as such is negative: > > echo PHP_INT_MIN; // -9223372036854775808 > echo PHP_FLOAT_MIN; // 2.2250738585072E-308 > > If it is intended, maybe the doc > should be clear > about this, at the moment it is just: > > Smallest representable floating point number. > > > Which is confusing IMO. > > Perhaps confusing, but not without precedent. See the C++ definitions for ::min() and ::lowest() on https://en.cppreference.com/w/cpp/types/numeric_limits. std::numeric_limits::min() is a positive value very near zero. std::numeric::limits::lowest() is a very large negative value. -Sara --000000000000a2e4c30585a299f7--