|
@@ -18,24 +18,16 @@ Eshell V13.2 (abort with ^G)
|
|
|
2> niftest:hello().
|
|
|
"Hello world!"
|
|
|
3> niftest:factorial(5).
|
|
|
-<<"x">>
|
|
|
-4> binary:decode_unsigned(niftest:factorial(5)).
|
|
|
120
|
|
|
-5> niftest:factorial(20).
|
|
|
-<<33,195,103,124,130,180,0,0>>
|
|
|
-6> binary:decode_unsigned(niftest:factorial(20)).
|
|
|
+4> niftest:factorial(20).
|
|
|
2432902008176640000
|
|
|
-7> niftest:factorial(34).
|
|
|
-<<222,27,196,209,158,252,172,130,68,93,167,91,0,0,0,0>>
|
|
|
-8> binary:decode_unsigned(niftest:factorial(34)).
|
|
|
+5> niftest:factorial(34).
|
|
|
295232799039604140847618609643520000000
|
|
|
-9> niftest:factorial(35).
|
|
|
+6> niftest:factorial(35).
|
|
|
{error,"input too large, max is 34"}
|
|
|
-10> niftest:factorial(-5).
|
|
|
-** exception error: bad argument
|
|
|
- in function niftest:factorial/1
|
|
|
- called as niftest:factorial(-5)
|
|
|
-11> q().
|
|
|
+7> niftest:factorial(-5).
|
|
|
+{error,badarg}
|
|
|
+8> q().
|
|
|
ok
|
|
|
|
|
|
|
|
@@ -45,3 +37,4 @@ https://www.erlang.org/docs/25/man/erl_nif.html
|
|
|
https://www.erlang.org/doc/system/nif.html
|
|
|
https://www.erlang.org/doc/system/debugging.html
|
|
|
```
|
|
|
+
|