The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::StringNumericLiteral::NativeNumberSemantics - ECMAScript 262, Edition 5, lexical string numeric grammar default semantics package, using native perl representations

VERSION

version 0.014

DESCRIPTION

This modules provide a default semantics package for the actions associated to ECMAScript_262_5 lexical string numeric grammar, using native number representation, with the possible exceptions of positive zero and positive infinity: If one of them is not available natively, then the Math::BigFloat representation is used.

For this reason, this module exports two class methods to test if a number is zero or not, that use the native library or Math::BigFloat.

For convenience, even if this is not formally in the string numeric grammar, the neg_zero(), neg_infinity(), nan(), is_zero(), is_infinite() and is_nan() methods are also exported.

new($class)

Instantiate a new object that has two members: number initialized to host's positive zero, and length initalized to host's positive zero.

host_mul($self, $objmul)

Host implementation of $self multiplied by $objmul. Returns $self.

host_round($self)

Host implementation of rounded $self. Returns $self.

host_pos_zero($self)

Host implementation of $self setted to positive zero, defaulting to Data::Float::pos_zero if your host have signed zeroes, 0 otherwise. Returns $self.

host_pos_inf($self)

Host implementation of $self setted to positive infinity, defaulting to Data::Float::pos_infinity if your host have infinity, otherwise a trial between (~0)**(~0) and {my $n = 2; $n *= $n while $n < $n*$n; $n}. Return $self.

host_pow($self, $powobj)

Host implementation of $self setted to 10 ** $powobj. Returns $self.

host_int($self, $string)

Host implementation of $self setted to positive integer represented in $string, length initialized to the number of characters in $string. Returns $self.

host_hex($self, $string)

Host implementation of $self setted to positive hexadecimal integer represented in $string. Returns $self.

host_neg($self)

Host implementation of $self sign change. Returns $self.

host_add($self, $addobj)

Host implementation of $addobj added to $self. Returns $self.

host_sub($self, $subobj)

Host implementation of $subobj substracted from $self. Returns $self.

host_inc_length($self)

Increase by one the host representation of the number of characters used to evaluate the host value. Returns $self.

host_new_from_length($self)

Returns the a new object derived from the number of characters used to evaluate the host value of $self. Returns the new object instance.

host_class($self)

Returns the host class that, when called as class->new, is creating a new object.

host_value($self)

Returns the host implementation of value hosted in $self.

pos_zero($class)

Class method that returns the host implementation of (positive if any) zero, or its Math::BigFloat implementation otherwise.

neg_zero($class)

Class method that returns the host implementation of (negative if any) zero, or its Math::BigFloat implementation otherwise.

pos_infinity($class)

Class method that returns the host implementation of (positive if any) infinity, or its Math::BigFloat implementation otherwise.

neg_infinity($class)

Class method that returns the host implementation of (negative if any) infinity, or its Math::BigFloat implementation otherwise.

nan($class)

Class method that returns the host implementation of NaN, or its Math::BigFloat implementation otherwise.

is_zero($class, $value)

Class method that returns true or false if $value is zero. In case $value would be a blessed object, $value->is_zero() is returned if $value can do this method, otherwise undef is returned.

is_infinite($class, $value)

Class method that returns true or false if $value is infinite. In case $value would be a blessed object, $value->is_inf() is returned if $value can do this method, otherwise undef is returned.

is_nan($class, $value)

Class method that returns true or false if $value is NaN. In case $value would be a blessed object, $value->is_nan() is returned if $value can do this method, otherwise undef is returned.

AUTHOR

Jean-Damien Durand <jeandamiendurand@free.fr>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Jean-Damien Durand.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.