use strict; use warnings; use Test::More tests => 1; use Inline C => Config => BUILD_NOISY => 1, ; use Inline C => <<'EOC'; SV * foo(SV * arg, int if_branch) { SV * keysv; char buff[32]; keysv = NEWSV(0, 32); /* Make sure arg is an NV */ if(!SvNOK(arg)) croak("Not a valid arg for this demo"); if(if_branch) { sv_setpvf(keysv, "%.19g", SvNV(arg)); } else { sprintf(buff, "%.19g", SvNV(arg)); sv_setpvf(keysv, "%s", buff); } return keysv; } EOC my $d = 2 ** 63; my $if = foo($d, 1); # uses if branch my $else = foo($d, 0); # uses else branch is($if, $else, 'they are the same');