Skip to content

Instantly share code, notes, and snippets.

@perlpilot
Created May 26, 2011 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlpilot/993743 to your computer and use it in GitHub Desktop.
Save perlpilot/993743 to your computer and use it in GitHub Desktop.
our sub upgrade_to_num_if_needed($test) {
Q:PIR {
.local num test
$P0 = find_lex '$test'
test = $P0
if test > 2147483647.0 goto upgrade
if test < -2147483648.0 goto upgrade
$I0 = test
.return ($I0)
upgrade:
.return (test)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment