aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorFilipe David Manana <[email protected]>2011-06-08 17:33:18 +0100
committerFilipe David Manana <[email protected]>2011-06-08 17:36:39 +0100
commit8db78b0c92a26e2a7766f8ece2f0ed7abb5db791 (patch)
tree6c51aec6b82b4420e5284c5aac077df32ed8e8c0 /erts/emulator/beam/erl_nif.c
parent3b818d5ec09cd2bb4c650776b898af9206f13c68 (diff)
downloadotp-8db78b0c92a26e2a7766f8ece2f0ed7abb5db791.tar.gz
otp-8db78b0c92a26e2a7766f8ece2f0ed7abb5db791.tar.bz2
otp-8db78b0c92a26e2a7766f8ece2f0ed7abb5db791.zip
Add NIF function enif_is_number
This function allows for easily determining if a term represents or not a number (integer, float, small or big).
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 68421b4387..7ea0e1f6b2 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -435,6 +435,11 @@ int enif_is_exception(ErlNifEnv* env, ERL_NIF_TERM term)
return term == THE_NON_VALUE;
}
+int enif_is_number(ErlNifEnv* env, ERL_NIF_TERM term)
+{
+ return is_number(term);
+}
+
static void aligned_binary_dtor(struct enif_tmp_obj_t* obj)
{
erts_free_aligned_binary_bytes_extra((byte*)obj,ERTS_ALC_T_TMP);