module Data.Float.Base where
headerπ
postulate Float : Type {-# BUILTIN FLOAT Float #-} private module P where primitive -- Relations primFloatInequality : Float β Float β Bool primFloatEquality : Float β Float β Bool primFloatLess : Float β Float β Bool primFloatIsInfinite : Float β Bool primFloatIsNaN : Float β Bool primFloatIsNegativeZero : Float β Bool primFloatIsSafeInteger : Float β Bool -- Conversions primFloatToWord64 : Float β Maybe Word64 primFloatToWord64Injective : β a b β primFloatToWord64 a β‘α΅’ primFloatToWord64 b β a β‘α΅’ b primNatToFloat : Nat β Float primIntToFloat : Int β Float primFloatRound : Float β Maybe Int primFloatFloor : Float β Maybe Int primFloatCeiling : Float β Maybe Int primFloatToRatio : Float β (Ξ£ Int Ξ» _ β Int) primRatioToFloat : Int β Int β Float primFloatDecode : Float β Maybe (Ξ£ Int Ξ» _ β Int) primFloatEncode : Int β Int β Maybe Float -- Operations primFloatPlus : Float β Float β Float primFloatMinus : Float β Float β Float primFloatTimes : Float β Float β Float primFloatDiv : Float β Float β Float primFloatPow : Float β Float β Float primFloatNegate : Float β Float primFloatSqrt : Float β Float primFloatExp : Float β Float primFloatLog : Float β Float primFloatSin : Float β Float primFloatCos : Float β Float primFloatTan : Float β Float primFloatASin : Float β Float primFloatACos : Float β Float primFloatATan : Float β Float primFloatATan2 : Float β Float β Float primFloatSinh : Float β Float primFloatCosh : Float β Float primFloatTanh : Float β Float primFloatASinh : Float β Float primFloatACosh : Float β Float primFloatATanh : Float β Float open P public renaming ( primFloatInequality to _floatβ _ ; primFloatEquality to _float=_ ; primFloatLess to _float<_ ; primFloatIsInfinite to is-infinite? ; primFloatIsNaN to is-nan? ; primFloatIsNegativeZero to is-neg0? ; primFloatIsSafeInteger to is-integer? ; primFloatToWord64 to floatβword64 ; primNatToFloat to natβfloat ; primIntToFloat to intβfloat ; primFloatRound to round ; primFloatFloor to floor ; primFloatCeiling to ceiling ; primFloatToRatio to floatβratio ; primRatioToFloat to ratioβfloat ; primFloatDecode to decode-float ; primFloatEncode to encode-float ; primFloatPlus to _+,_ ; primFloatMinus to _-,_ ; primFloatTimes to _*,_ ; primFloatDiv to _/,_ ) using () instance Discrete-Float : Discrete Float Discrete-Float = Discrete-inj' _ (P.primFloatToWord64Injective _ _) Number-Float : Number Float Number-Float .Number.Constraint _ = β€ Number-Float .Number.fromNat s = natβfloat s