Ad
  • Custom User Avatar

    Kotlin translation waiting for approval

  • Default User Avatar

    I'm (still) experiencing floating point errors.

    can compute general complex signum
    expected: Complex 0.6 0.8
     but got: Complex 0.6000000000000001 0.8
    

    Edit: I "solved" the problem by explicitly defining division (/) instead of only defining recip. Now my solution passes all example test cases. However when I submit it, it still gives an error every time.

    can compute general complex signum
    Falsifiable (after 1 test and 309 shrinks): 
    NonZero {getNonZero = 1.4e-44}
    NonZero {getNonZero = 1.0e-45}
    
  • Custom User Avatar

    If you structure main as

    main = do
      hspec $ do
        describe "" $ do
          it "" $ do
            x `shouldBe` y
      hspec $ do
        describe "" $ do
          it "" $ do
            a `shouldBe` b
    

    you don't increase the test indent continuously.

    Quite unessential, but I think it looks better.