This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
README

IsFibonacciNumber

This library determines if an Int is a Fibonacci Number.

Usage

test : Int -> Bool

Determine if an Int is a Fibonacci Number.

test -1 == False
test 0 == False
test 3 == True
test 4 == False
module IsFibonacciNumber (test) where

{-| This library determines if an Int is a Fibonacci Number.

# Usage
@docs test

-}

{-| Determine if an Int is a Fibonacci Number.

    test -1 == False
    test 0 == False
    test 3 == True
    test 4 == False

-}
test : Int -> Bool
test n =
  let
    nCommon = 5 * (toFloat n)^2
    nPos = sqrt (nCommon + 4)
    nNeg = sqrt (nCommon - 4)
  in
    if n <= 0
      then False
      else
        toFloat(floor nPos) == nPos || toFloat(floor nNeg) == nNeg