summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/rational.c b/rational.c
index a78b320..e5992ed 100644
--- a/rational.c
+++ b/rational.c
@@ -571,6 +571,18 @@ f_rational_new_no_reduce2(VALUE klass, VALUE x, VALUE y)
*
* Rational(1, 2) #=> (1/2)
* Rational('1/2') #=> (1/2)
+ *
+ * Syntax of string form:
+ *
+ * rational = [ sign ] , unsigned rational ;
+ * unsigned rational = numerator | numerator , "/" , denominator ;
+ * numerator = integer part | fractional part | integer part , fractional part ;
+ * denominator = digits ;
+ * integer part = digits ;
+ * fractional part = "." , digits , [ ( "e" | "E" ) , [ sign ] , digits ] ;
+ * sign = "-" | "+" ;
+ * digits = digit , [ { digit | "_" , digit } ] ;
+ * digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
*/
static VALUE
nurat_f_rational(int argc, VALUE *argv, VALUE klass)