Modified:
/trunk/math.axi
/trunk/string.axi
=======================================
--- /trunk/math.axi Thu May 27 23:58:59 2010
+++ /trunk/math.axi Sun Aug 8 17:00:49 2010
@@ -228,6 +228,26 @@
return (hi & $7FF00000) >> 20 == $7FF &&
!(hi & $FFFFF || math_double_low_to_bits(x))
}
+
+/**
+ * Checks if a string value contains only a numeric value.
+ *
+ * @param a a string to check
+ * @return a boolean, true is a is numeric
+ * @todo support signed numbers
+ */
+define_function char is_numeric(char a[])
+{
+ stack_var integer i
+
+ for (i = 1; i <= length_string(a); i++) {
+ if (!(a[i] >= $30 && a[i] <= $39)) {
+ return 0
+ }
+ }
+
+ return 1
+}
/**
* Compares two numbers and return true if they are within MATH_PRECISION
of
@@ -519,11 +539,12 @@
}
-DEFINE_START
-
-MATH_NaN = math_build_double($7FFFFFFF, $FFFFFFFF)
-MATH_POSITIVE_INFINITY = math_build_double($7FF00000, $00000000)
-MATH_NEGATIVE_INFINITY = math_build_double($FFF00000, $00000000)
-MATH_TWO_52 = 1 << 52
+define_start
+{
+ MATH_NaN = math_build_double($7FFFFFFF, $FFFFFFFF)
+ MATH_POSITIVE_INFINITY = math_build_double($7FF00000, $00000000)
+ MATH_NEGATIVE_INFINITY = math_build_double($FFF00000, $00000000)
+ MATH_TWO_52 = 1 << 52
+}
#end_if
=======================================
--- /trunk/string.axi Thu May 27 23:58:59 2010
+++ /trunk/string.axi Sun Aug 8 17:00:49 2010
@@ -52,7 +52,7 @@
define_function char[STRING_RETURN_SIZE_LIMIT] string_size_error()
{
// handle, alert, ignore etc here
- println("'Return size to small in String.axi'")
+ println("'Maximum return size too small in String.axi'")
return 'error'
}