We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec5c324 commit 8c6da2dCopy full SHA for 8c6da2d
1 file changed
Clojure/Clojure/Lib/Numbers.cs
@@ -2123,8 +2123,11 @@ static public object abs(object x)
2123
#region converters to object
2124
2125
2126
- public static object num(object x) { return x; }
2127
-
+ public static object num(object x) {
+ if (!Util.IsNumeric(x))
2128
+ throw new InvalidCastException("Argument is not numeric");
2129
+ return x;
2130
+ }
2131
2132
public static object num(float x) { return x; }
2133
0 commit comments