Commits on Oct 21, 2016
  1. Fix acosh for large negative numbers

    The IEEE 754-2008[^1], Section 9.2, says acosh for values < 1 is a NaN.
    We do that for numbers with small maginitude and -∞ itself, but for
    large negative numbers (e.g. -1e100 and -1e200) we end up returning ±∞
    Fix by detecting out-of-domain input and returning NaN without performing
    any calculations. This commit fixes Num and num versions, but not Complex.
    I need to do further research on complex numbers to know how to fix them.
    zoffixznet committed Oct 21, 2016
Commits on Oct 20, 2016
  1. Immutable Set/Bag/Mix cannot be auto-vivified

    lizmat committed Oct 20, 2016
  2. Make Mix/MixHash.Bag/BagHash coersion ignore negative weights

    Mixies can have negative weights, but Bag/BagHash can't. If we
    have a Mixy with negative weights the coercion fails. Make it
    succeed by having the Mixies toss negative weights before the coersion.
    zoffixznet committed Oct 20, 2016
  3. Make QuantHash:U AT-KEY autovivify to QuantHash object, not Hash

    Currently, when attempting to do AT-KEY operations on Setties and Baggies,
    the autovivification is handled by Any:U.AT-KEY, which defaults to creating
    a Hash object. This causes issues with my BagHash $b; $b<foo>++, since an
    attempt to assign a Hash to BagHash variable results in an exception.
    Fix by adding AT-KEY for QuantHash:U; a role that Setties and Baggies do
    that will create an appropriate object instead of a Hash.
    zoffixznet committed Oct 20, 2016
  4. Introduce Iterator.skip-one

    A method that can be overriden if you're writing an iterator that can
    be significantly cheaper when skipping a generated value.  Use case,
    the :10nth parameter with Str.match (aka, give me only the 10th match).
    By default, it is just a slightly more expensive .pull-one.
    Also use let Iterator.skip-at-least-pull-one use skip-one, as well
    as in Rakudo::Internals.SeqSkipNFromIterator .
    lizmat committed Oct 20, 2016
Commits on Oct 19, 2016
  1. Fix asinh(-∞) to return -∞, not NaN

    The 2008 IEEE 754[^1], table 9.1, lists asinh() as having -∞..∞ domain,
    without any special expections. Furthermore, section "9.2.1 Special values"
    states "sinh(±∞) and asinh(±∞) are ±∞ with no exception" which we comply with
    in all cases but asinh(-∞), which returns a NaN.
    Detect ±Inf/NaN and return them without doing computation. Complex.asinh() needs
    similar treatment, but I need to research how to do trig on complex numbers.
    zoffixznet committed Oct 19, 2016
  2. Close a unit's handle when it's found outdated.

    This fixes an issue on Windows where precomp repositories could not
    rename a newly compiled file to match the name of the the original
    file (thus replacing it), because we still had the original one open.
    Windows is fussy about such things.
    jnthn committed Oct 19, 2016
  3. Fix num-typed hyperbolic inverse sin/cos functions

    The formula for asinh is ln(x + √(x²+1)) and for acosh is ln(x + √(x²-1)).
    The current multies for num types are missing the square roots.
    Correct the calculation. Rewrite using nqp ops for 6.2x speed gain.
    zoffixznet committed Oct 19, 2016
  4. Fix missing close in IO::Path.slurp(:bin).

    jnthn committed Oct 19, 2016
  5. Fix incorrect calculation produced by acotan(num)

    The num version of the method uses incorrect formula to calculate acotan.
    The following identities should hold:
        θ = acotan cotan θ for -π < θ < π
        θ = cotan acotan θ for θ ∈ ℝ
    Fix by calculating atan(1/x), result of which is corroborated by the above
    identities, WolframAlhpa[^1], and our implementation of acotan for boxed types.
    zoffixznet committed Oct 19, 2016
  6. Missing clone of codeblocks embedded in regexes.

    Could cause over-sharing when a grammar was used on multiple threads.
    jnthn committed Oct 19, 2016
  7. Make ∞ ≅ ∞ give True

    Since ∞ == ∞ is True, and, say, 2 ≅ 2 is True, it makes sense for ∞ ≅ ∞ to
    be True as well. However, the math involved produced a NaN, which made the
    operator return False for infinities.
    Add two extra candidates that handle ∞ ≅ ∞ and -∞ ≅ -∞
    zoffixznet committed Oct 19, 2016
  8. Bump NQP_REVISION for some MoarVM fixes.

    One involving a callframe crash (jnthn++), one involving a mkdir bug
    on Windows (FROGGS++).
    jnthn committed Oct 19, 2016
Commits on Oct 18, 2016
  1. Consider current $indent when blanking empty _diag() lines

    zoffixznet committed Oct 18, 2016
  2. Make _diag propagate indents to each line of diag message

    Fixes staggered indents with multi-line failure messages/user-triggered
    diag() messages that are output while running inside a subtest()
    zoffixznet committed Oct 18, 2016
  3. Make is-approx include actual received values in failure output

    Sample, when both tolerances are set:
    │not ok 1 -
    │# Failed test at -e line 1
    │#     expected approximately: -0.785398163397448
    │#                        got: 2.35619449019234
    │# maximum absolute tolerance: 1e-100
    │# actual absolute difference: 3.14159265358979
    │# maximum relative tolerance: 0.1
    │# actual relative difference: 1.33333333333333
    zoffixznet committed Oct 18, 2016
  4. Make is-approx DWIM when no tolerances are provided

    When current version was designed, the default was chosen to abs-tol of 1-e5, with
    reasoning behind that it would be easy for users to understand it (as compared with
    rel-tol or some DWIM mechanism). While that goal was accomplished, when using the
    function in real-world application, the abs-tol default proves to be nearly useless.
    It's too small for large numbers and too large for small numbers, forcing the user to
    specify manually. Moreover, rel-tol can't be used when $expected is zero, so the user
    constantly has to think about which tolerances to plug into the function.
    This commit restores the DWIMmy behaviour of old is_approx for the default case where
    no tolerances are given: if $expected.abs() is smaller than 1e-6, use absolute
    tolerance of 1e-5; else, use relative tolerance of 1e-6.
    Both the existing Rakudo tests for this function and the entire stresstest passes with
    these changes, but that's mostly due to undertesting (or in roast's case, no testing).
    I looked at ecosystem usages and the function isn't used frequently. Both of those
    suggest to me the impact of this change would be minimal, if not entirely non-existent.
    zoffixznet committed Oct 18, 2016
  5. bump nqp/moar to unbust windows

    FROGGS committed Oct 18, 2016
  6. Fix edge case in is-approx that triggers DivByZero exception

    If both $got and $expected are zero, their absolute max is also zero,
    so we end up dividing by zero to calculate relative difference. This
    was actually silent due to 0/0 <= Int returning True, however other
    Numerics give False, triggering test failure, and the explosion when
    attempting to print the resultant relative difference to user.
    zoffixznet committed Oct 18, 2016
  7. Introducing Rakudo::Internals.SeqSkipNFromIterator

    Create a Seq from an iterator skipping N generated values first
    lizmat committed Oct 18, 2016
Commits on Oct 17, 2016
  1. Make atanh(1) return Inf instead of throwing

    The 2008 IEEE 754[^1] section 9.2, states atanh(x) with |x| = ∞ is a divideByZero
    exception. In section 9.1.1, it states this is indicated by a function, which then is
    to return ∞. And section 7.3 describes the default value of divideByZero as ∞.
    The speculation[^2] states "floating-point modes do not throw exceptions but rather
    propagate ∞ and NaN," and in fact, atan(-1) does return a -∞. Furthermore, the
    following languages and tools almost universally give a ∞ for atan(1):
    R: ∞; Rust: ∞; C: ∞; Ruby: ∞; Perl 5: ∞; WolframAlpha: ∞; Python: math domain error
    zoffixznet committed Oct 17, 2016
  2. Introduce Rakudo::Internals.SeqUsingIndexIterator

    Create a Seq from a Seq and an iterator supplying index values.
    Originally created as part of the Str.match refactor work, but
    turned out to be not needed as part of that.  So for now, this
    will sit here until we start looking at slicing of (multidim)
    arrays again.  Or be removed should it turn out not to be needed
    after all.
    lizmat committed Oct 17, 2016
Commits on Oct 16, 2016
  1. Fix infix:<x> accidentally silencing failures

    An earlier fix[^1] to interpret type objects as 0 iterations had an unintended
    effect that Failures from the coercion of the RHS argument to Int would also be
    silently treaded as 0.
    Add a separate multi for type objects to handle that case, leaving
    coercion Failures able to freely explode.
    Fixes RT#129899:
    [1] 2311372
    zoffixznet committed Oct 16, 2016
  2. Merge pull request #905 from dod38fr/nom

    Fix pod syntax error in running.pod
    zoffixznet committed on GitHub Oct 16, 2016
  3. Fix pod syntax error in running.pod

    Added the missing =back found by podchecker
    dod38fr committed Oct 16, 2016
  4. Add return type constraints for native nummy subs

    To allow for current/future inlining/optimizations based on knowledge
    of return types.
    zoffixznet committed Oct 16, 2016
  5. bump nqp/moar for .pick fix

    FROGGS committed Oct 16, 2016
Commits on Oct 15, 2016
  1. Prep 2016.11 section

    zoffixznet committed on GitHub Oct 15, 2016
  2. 2016.10 is now in the past

    zoffixznet committed on GitHub Oct 15, 2016
  3. [release] bump VERSION to 2016.10

    zoffixznet committed Oct 15, 2016
  4. [release] bump NQP revision

    zoffixznet committed Oct 15, 2016
  5. does is a mutator, so should want its left arg

    TimToady committed Oct 15, 2016
  6. Make List.tail work on JVM for now

    We cannot presently bind native attributes in a signature yet.
    lizmat committed Oct 15, 2016
  7. Remove overflow check on native infix:<*> and infix:<**>

    To preserve 1-type-of-return and inlining, we do not[^1] do overflow checks
    on native subs.
    zoffixznet committed Oct 15, 2016