Example #1
0
        public override AType ExecutePrimitive(AFloat argument, Aplus environment = null)
        {
            int result;

            if (argument.ConvertToRestrictedWholeNumber(out result))
            {
                return(calculateNot(result));
            }
            throw new Error.Type(TypeErrorText);
        }
Example #2
0
        public override AType ExecutePrimitive(AFloat argument, Aplus environment = null)
        {
            int number;

            if (!argument.ConvertToRestrictedWholeNumber(out number))
            {
                throw new Error.Type("Bitwise not");
            }

            return(AInteger.Create(~number));
        }
Example #3
0
        public override AType ExecutePrimitive(AFloat argument, Aplus environment)
        {
            int seed = GetSeed(environment);
            int result;

            if (!argument.ConvertToRestrictedWholeNumber(out result))
            {
                throw new Error.Type(TypeErrorText);
            }

            return(generateRandomNumber(seed, result));
        }