''' Float - A mutable float class

##################################################
###### AUTOGENERATED - DO NOT EDIT DIRECTLY ######
##################################################
'''

import sys
from mutable_primitives.base import Mutable


class Float(Mutable):
    ''' Float - A mutable float class '''
    base = float

    def __init__(self, val):
        super(Float, self).__init__(val, self.base) #pylint: disable=super-with-arguments
        self.val = val

    def get(self):
        ''' get raw (primitive) value '''
        return self.val

    def set(self, val):
        ''' set raw (primitive) value '''
        assert isinstance(val, self.base)
        self.val = val

    def __eq__(self, other):
        return self.val == other

    def __ne__(self, other):
        return self.val != other

    def __str__(self):
        return '{}({})'.format(self.__class__.__name__, self.val)

    def __repr__(self):
        return '{}({})'.format(self.__class__.__name__, self.val)

    def __bool__(self):
        ''' boolean test for python3 '''
        if self.val:
            return True
        return False

    def __nonzero__(self):
        ''' boolean test for python2 '''
        if self.val:
            return True
        return False

    def __add__(self, other):
        return self.val + other

    def __sub__(self, other):
        return self.val - other

    def __mul__(self, other):
        return self.val * other

    if sys.version_info[0] < 3:
        def __div__(self, other):
            return self.val / other
    else:
        def __floordiv__(self, other):
            return self.val // other

        def __truediv__(self, other):
            return self.val / other

    def __radd__(self, other):
        return other + self.val

    def __rsub__(self, other):
        return other - self.val

    def __rmul__(self, other):
        return other * self.val

    if sys.version_info[0] < 3:
        def __rdiv__(self, other):
            return other / self.val
    else:
        def __rfloordiv__(self, other):
            return other // self.val

        def __rtruediv__(self, other):
            return other / self.val

    def __iadd__(self, other):
        self.val += other
        return self

    def __isub__(self, other):
        self.val -= other
        return self

    def __imul__(self, other):
        self.val *= other
        return self

    if sys.version_info[0] < 3:
        def __idiv__(self, other):
            self.val /= other
            return self
    else:
        def __ifloordiv__(self, other):
            self.val //= other
            return self

        def __itruediv__(self, other):
            self.val /= other
            return self
