package Somename; use Math::BigFloat; sub new { my $class = shift; my $self = bless {}; $self -> { underlying } = Math::BigFloat -> new( @_ ); return ( $self, $class ); } sub fsetround { # e.g. $obj -> fsetround( mode => 'FE_DOWNWARD' ); my $self = shift; my %opt = @_; while ( my ( $k, $v ) = each %opt ) { $self -> { $k } = $v; } # set defaults here e.g. for round by default # to 17 digits from the left $self -> { scale } ||= 17; } sub fgetround my $self = shift; if ( $self -> { mode } eq 'FE_DOWNWARD' ) { my $bf = $self -> { underlying }; return $bf -> ffround( -( $self -> { scale } ) ); } # elsif ... # etc. for the other features of fenv }
^M Free your mind!
In reply to Re: Is there a better way to call fe(get|set)round?
by Moron
in thread Is there a better way to call fe(get|set)round?
by HollyKing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |