HuwCampbell/avro/1.0.1

Avro.Value.Int64

This module implents a signed 64 bit integer.

Javascript platforms do not natively have a signed 64 bit integer type, though the Avro specification assumes the existence of one.

type alias Int64 =
Int64

A 64 bit signed integer.

This type is encoded using two Int values by the concatentation of their bitwise representations.

fromInt : Int -> Int64

Create a 64 bit integer from an Elm Int.

This is guaranteed to work for integers within the javascript safe integer range.

toInt : Int64 -> Maybe Int

Build a standard Int from an Int64.

This will return integers within the javacript safe range; values outside of this will result in a Nothing.

fromPair : Int -> Int -> Int64

Build a long from upper and lower bits of ints.

toPair : Int64 -> ( Int, Int )

Render an Int64 to a pair of upper and lower bit ints.

toFloat : Int64 -> Float

Create a standard Float value from an Int64.

This will lose precision beyond the javascript safe integer range.

compare : Int64 -> Int64 -> Order

Compare 2 64 bit signed integers.