in reply to Determining the minimum representable increment/decrement possible?
With the latest MS compiler that I have (14.00.40310.41) I need to replace "nextafter" with "_nextafter" in order to get the script to compile.use strict; use warnings; use Inline C => Config => BUILD_NOISY => 1, ; use Inline C => <<'EOC'; double nxtafter(double in, double dir) { return nextafter(in, dir); } EOC my $pos_inf = (99 ** 99) ** 99; my $neg_inf = -$pos_inf; my $next_down = nxtafter(1.9041105342991877e+258, $neg_inf); printf "%.16e\n", $next_down; my $next_up = nxtafter(-8.2727285363069939e-293, $pos_inf); printf "%.16e\n", $next_up; __END__ Outputs: 1.9041105342991875e+258 -8.2727285363069927e-293
Perhaps a more recent MS compiler fares better.1.9041105342991884e+258 -7.9999999999999937e-293
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Determining the minimum representable increment/decrement possible?
by BrowserUk (Patriarch) on Jun 16, 2016 at 13:24 UTC | |
by syphilis (Archbishop) on Jun 16, 2016 at 14:03 UTC | |
by pryrt (Abbot) on Jun 16, 2016 at 13:43 UTC | |
by fullermd (Vicar) on Jul 05, 2016 at 07:29 UTC |